Four In One Demo (X02)

From Microduino Wiki
Jump to: navigation, search
Four In One Demo Project Build
Spinning the Demo in Mode 2 creates a rainbow effect.


This project uses the Core module, LED Matrix module, Motion module and OLED module to demonstration several project demos using these modules.

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

Required Materials

  • 1 x mCookie Core
  • 1 x mBattery (202/302 Kit)
  • 1 x mCookie LED Matrix
  • 1 x mCookie Motion
  • 1 x mCookie OLED
  • 1 x MicroUSB Cable



  1. Stack the mCookie Core onto mBattery.
  2. Plug in the MicroUSB cable to the mBattery to a computer.
  • NOTE: See #Usage for further instructions on assembly.


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

2. Download the project file and unzip: File:Four In One Demo

  • Using the Microduino IDE and go to File > Open... and navigate to the unzipped folder. Open the Four_In_One_Demo_X02.ino file.

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.


  • Open the Serial monitor. Information will be displayed.


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



LED_MAX set maximum brightness value for the LED. Be careful with large values as the LED is extremely bright!

  • Default: 20
  • Range: 0 (always off) ~ 255 (blinding)


Disconnecting and reconnecting the modules can fix the issue with detecting the different modes.


This project has various modes and can be activated on the fly.

  • Mode 1 - Stack a Core module and LED Matrix onto mBattery.
    • The LED Matrix will light up.
  • Mode 2 - Stack a Core module and OLED onto mBattery.
    • The OLED will display a message.
  • Mode 3 - Stack a Core module, Motion module and LED Matrix onto mBattery.
    • The LED Matrix will change colors based on the angle. Spin the mBattery with the module connected and the colors on the LED Matrix will change.
  • Mode 4 - Stack a Core module, Motion module, LED Matrix module and OLED module onto mBattery. Ensure that the LED Matrix module is on top of one stack and the OLED module is on top of the other stack.
    • A smiley face will appear on the the center of the OLED module. Tilting the modules will cause the smiley face to move around accordingly. The color of the LED Matrix will change accordingly to the tilt of the modules.