A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.sparkfun.com/tutorials/qwiic-pro-kit-project-guide below:

Qwiic Pro Kit Project Guide

Contributors:

M-Short

,

bboyho Introduction Note:

Unfortunately, the accelerometer (MMA8452Q) included in this kit went EOL. If you are looking for the latest version of this kit and tutorial, head over to the

MicroMod Qwiic Pro Kit Project Guide

!

The Qwiic Pro Kit was designed to allow users to get started with Arduino without the need for soldering or a breadboard. We've included three inputs (a joystick, accelerometer, and proximity sensor) and one display that can be daisy chained to your Arduino. Hooking up a handful of inputs and outputs to an Arduino has never been so easy with the Qwiic system!

SparkFun Qwiic Pro Kit KIT-15349

This kit provides you with a RedBoard Turbo, two sensors, a joystick, and an OLED screen as well as all the cables you need t…

Retired Suggested Reading

If you aren't familiar with the Qwiic system, we recommend reading here for an overview.

We would also recommend taking a look at the following tutorials to set up the RedBoard Turbo and get a feel for each Qwiic component.

Qwiic Accelerometer (MMA8452Q) Hookup Guide

Freescale’s MMA8452Q is a smart, low-power, three-axis, capacitive micro-machined accelerometer with 12-bits of resolution. It’s perfect for any project that needs to sense orientation or motion. We’ve taken that accelerometer and stuck it on a Qwiic-Enabled breakout board to make interfacing with the tiny, QFN package a bit easier.

Qwiic Joystick Hookup Guide

Looking for an easy way to implement a joystick to your next Arduino or Raspberry Pi project? This hookup guide will walk you through using the Qwiic Joystick with the Arduino IDE on a RedBoard Qwiic and in Python on a Raspberry Pi.

Hardware Hookup

The Qwiic connection system makes it easy to connect the boards together. Simply grab a Qwiic cable of your choice to connect. If you are using the demo code from this tutorial to play micro pong, you will need to connect all the boards together. We recommend using longer cable lengths for users using the Qwiic boards to control each paddle and placing them on opposite sides of the micro OLED. We also found it easier to add the accelerometer at the end of the daisy chain since the board requires movement. Additionally, you will need to orient the micro OLED so that the paddle is on the side of the player's Qwiic board after uploading the example code.

Warning! You will need to connect all of the boards together when using the demo code in this tutorial. Otherwise, you will need to comment out lines of code for the Qwiic board that is not connected to the daisy chain.

Note:

The code used in this tutorial is also compatible with Atmega328P-based Arduinos like the RedBoard Qwiic! If you purchased the components separately or Qwiic Ideation Kit, the setup is the same. Instead of the RedBoard Turbo, you would be using the RedBoard Qwiic. Check the

note below for more information

when compiling for the Atmega328P-based microcontrollers!

SparkFun RedBoard Qwiic DEV-15123

The SparkFun RedBoard Qwiic is an Arduino-compatible development board with a built in Qwiic connector, eliminating the need …

SparkFun Qwiic Ideation Kit KIT-16262

The SparkFun Qwiic Ideation Kit is the smorgasbord of our best and most popular Qwiic boards that allows you to bring any pro…

Retired

Installing the Board Add-Ons and Drivers Note:

This code/library has been written and tested on Arduino IDE version v1.8.8. Otherwise, make sure you are using the latest stable version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on

installing the Arduino IDE.

There are a few board add-ons to install before you are able to upload code to your RedBoard Turbo. If you have not already, make sure to check out the RedBoard Turbo's hookup guide to install the SAMD21 and SparkFun board add-ons.

Drivers

Heads up! Please be aware that the RedBoard Turbo is NOT currently supported on Windows 8 due to a lack of support drivers for those specific OS's.

The RedBoard Turbo is now easier than ever to program, thanks the UF2 bootloader. With this bootloader, the RedBoard Turbo shows up on your computer as a USB storage device without having to install drivers for Windows 10, Mac, and Linux!

However, if you are using a Windows 7 OS, you will need to install SAMD drivers. Head to the RedBoard Turbo's hookup guide for more information about installing drivers for Windows 7.

Installing the Library Note:

If you have not previously installed an Arduino library, please check out our

installation guide.

SparkFun has written a library for the Qwiic enabled joystick, triple axis accelerometer (MMA8452Q), proximity sensor (VCNL4040), and 64x48 micro OLED. You can obtain these libraries through the Arduino Library Manager. Search for the following terms to automatically install the latest versions of each library. If you have issues compiling, you may need to download the respective library versions listed below.

If you prefer downloading the libraries manually, you can grab them from each of the respective GitHub repositories.

Example Code

We recommend grabbing the code from its the GitHub repository. Otherwise, you can download the zipped file from the link below.

After downloading, unzip the files and open the QwiicStarterExample.ino sketch. It should be located in the downloads folder similar to this path: .../Firmware/Arduino/QwiicStarterExample/QwiicStarterExample.ino. Open the code up in the Arduino IDE, select the board (i.e. the SparkFun RedBoard Turbo), and the COM port that the board enumerated on. Then hit the upload button.

Note:

To get the code working for an Atmega328P-based Arduino, simply comment out the line at the top by adding

//

in

front of the following line

:

#define Serial SerialUSB                            // Uncomment for RedBoard Turbo, this reroutes all Serial commands to SerialUSB
You'll also want to select the Arduino/Genuino Uno as the board before uploading and ensure that the CH340 drivers are installed for the RedBoard Qwiic.

With a friend, try rocking the accelerometer back and forth along the x-axis or moving your hand above the proximity sensor to control each paddle. You will need to orient the micro OLED so that the paddle is on the side of the player's Qwiic board. The game will continue as long as the ball hits the paddle and bounces to the other side. A player will win a round as soon as the other player fails to bounce the ball back to the other side. The current score will be briefly displayed before the next game. Try to rack up more points than your opponent!

Heads up! As with any distance sensor, there is a minimum distance at which the sensor can detect an object accurately. If your hand or finger is too close to the sensor, the readings for the distance can jump to a higher value causing the paddle to move off the screen. Make sure to be within the range to successfully hit the ball or try adjusting the code to include a minimum and maximum range for the paddle.

The default code uses the accelerometer as player 1 and the proximity sensor as player 2. Try adjusting the code to use the joystick for one of the players by adding and removing the single line comments. The joystick will control the paddle along the "vertical" y-axis. Each board can only have one player assigned. See if you can try to remove the unused Qwiic board from the daisy chain and commenting out each instance of the related board.

Resources and Going Further

Now that you've successfully got your Qwiic Starter Kit up and running, what will else will you build? For more information, check out the resource below:

Need some inspiration for your next project? Check out some of these related tutorials:

AS726X NIR/VIS Spectral Sensor Hookup Guide

It's now easier than ever to measure and characterize how different materials absorb and reflect different wavelengths of light. The AS726X spectral sensors allow you to detect wavelengths in the visible range (VIS) and near infrared range (NIR)!

LTE Cat M1/NB-IoT Shield Hookup Guide

The SparkFun LTE CAT M1/NB-IoT Shield equips your Arduino or Arduino-compatible microcontroller with access to data networks across the globe. This shield adds wireless, high-bandwidth cellular functionality to your IoT project!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4