Difference between revisions of "Joystick Lantern (X02)"

From Microduino Wiki
Jump to: navigation, search
m (Sonny moved page Joystick Latern (X02) to Joystick Lantern (X02): typo)
(Debugging)
Line 50: Line 50:
 
'''NOTE''': If not using the default Core module included in the kits, please follow the '''[[Selecting_board,_processor,_and_port|selecting the board and processor guide]]'''.
 
'''NOTE''': If not using the default Core module included in the kits, please follow the '''[[Selecting_board,_processor,_and_port|selecting the board and processor guide]]'''.
  
==Debugging==
+
=Debugging=
 
*Open the Serial monitor. Information on the color of the lantern will be displayed.
 
*Open the Serial monitor. Information on the color of the lantern will be displayed.
  

Revision as of 18:45, 5 April 2017

File:Joystick Lantern Project.jpg
Joystick Lantern Project Build

About

This project uses the Joystick trinket to change the colors of a color ColorLED or LED Matrix. Changing the direction of the Joystick will directly change the colors on the ColorLED or LED Matrix.

This project was designed for the second generation mCookie Maker kits (202 Advanced and 302 Expert kits).

Required Materials

This project can be built in two ways. Either using the LED Matrix (202 Advanced Kit or 302 Expert Kit required) or ColorLED (302 Expert Kit required) as the color changing lantern.

202 Advanced Kit or 302 Expert Kit required

  • 1 x mCookie Core
  • 1 x mBattery (202/302 Kit)
  • 1 x mCookie Sensor Hub
  • 1 x LED Matrix
  • 1 x Joystick
  • 1 x MicroUSB Cable

302 Expert Kit required

  • 1 x mCookie Core
  • 1 x mBattery (202/302 Kit)
  • 1 x mCookie Sensor Hub
  • 1 x ColorLED
  • 1 x Joystick
  • 1 x MicroUSB Cable

Build

Assembly

NOTE: When connecting sensor wires, push on the plastic connector and not on the wires. Pushing on the wire can damage them.

  1. Connect a Joystick to the Sensor Hub on Pin A2/A3.
  2. Connect a ColorLED to the Sensor Hub on Pin A0/A1 (302 Expert Kit compatible build).
  3. Create two stacks containing:
    1. (Bottom of Stack) Sensor Hub (Top of Stack)
    2. (Bottom of Stack) Core | LED Matrix (202 Advanced Kit build). (Top of Stack)
  4. Stack the two stacks onto the mBattery
  5. Plug in the MicroUSB cable to the mBattery to a computer.

Program

1. Connect mCookie Core to the PC with the USB Cable. Open the Microduino IDE.

2. Copy and paste the code below and upload.

3. Select the board, processor and port:

  • Go to Tools > Board and select Microduino/mCookie-Core (328p)
  • Go to Tools > Processor and select Atmega328P16M,5V
  • Go to Tools > Port and select the available port

4. Upload the program by clicking on the right arrow icon on the top left of the window. Or under Sketch > Upload.

NOTE: If not using the default Core module included in the kits, please follow the selecting the board and processor guide.

Debugging

  • Open the Serial monitor. Information on the color of the lantern will be displayed.

Tweaking

DEBUG will enable debugging mode. Which outputs information to the Serial Port.

Usage

Turn on the project and move the Joystick around in different directions to change the color of the lantern (ColorLED or LED Matrix).