Neon Lamp

From Microduino Wiki
Revision as of 02:21, 9 October 2016 by Fengfeng (talk)
Jump to: navigation, search


Outline

Anywhere LEDMatrix.jpg

Make a neon lamp, or named marquee, and makes 6 LEDs flash in turn.

Suitable kits: mCookie102, mCookie202, mCookie302


Module Bill

Module

Module Number Function
mCookie-Core 1 Core board
mCookie-USBTTL 1 Program download
MCookie-LED_Matrix 1 6 LED matrix

Other Equipment

  • USB cable*1
  • Sensor shell*1
  • Lego or other fixation structure
Anywhere LEDMatrix-module.jpg

Module Setup

Look at the New Module

6 LED matrix
mCookie-LED Matrix module integrates 6 lamp beads. Each has a built-in IC control chip, and the brightness state of the six can be controlled by one interface. It can be used as a full-color module set to provide light source.

Anywhere LEDMatrix-module—step.jpg
  • Assemble the modules and sensors:
    • Stick the red core module, USB upload module and green 6 LED matrix module together;
    • Insert one end of the USB cable into USB upload module, and connect the other to computer.

Programming

Required Program Blocks

"LED prepare" program block
"ColorLED control" program block
"Delay" program block
"Every time" program block
"Calculate" program block

Programming Thought

The arrange of the 6 LEDs of the matrix.

-ctrl-LEDMatrix.jpg

In order to implement neon lamp effect, we need to make the 6 LEDs flash in order.

Mixly-ctrl-LEDMatrix.jpg

Start Programming

1. LED prepare, controls the first 3 LEDs to light in order of which the numbers are 1,3,5.

Mixly-ctrl-LEDMatrix-code1.jpg

2. Control the last 3 LEDs to light in order the number of which are 6, 4, 2.

Mixly-ctrl-LEDMatrix-code2.jpg
  • Test the result
    • After upload, you can see the LEDs run in order!



Q: The program seems too long, is there some way to simplify it?
A: The required new program blocks are "Every time" program block and "Calculate” program block

  • Thought:
    • Variable i varies from 1to 3, and the corresponding LED numbers are 1, 3, 5. Variable i varies from 3 to 1, and the corresponding LED numbers are 6, 4, 2. Find out the relationship between variable i and the LED number.
Mixly-ctrl-LEDMatrix1.jpg

1. LED prepare, and control the first 3 LEDs with every time program block.

Mixly-ctrl-LEDMatrix-code3.jpg

2. Then use the every time program block to control the last 3 LEDs.

Mixly-ctrl-LEDMatrix-code4.jpg

Technical Specification

Related Cases

Q&A

Q: Are the LEDs in 6 LED matrix all same?
A: Yes, they are. The 6 LED matrix is equivalent to cascading six LEDs.