1
SKILL
LEVEL
Ringo Educational Guide Rev04.1 ~ Plum Geek
Using Ringo’s Color Lights
The signal line controlling the NeoPixel LEDs is also used to sense if someone is
pushing the User Button. When controlling the NeoPixels, this line is an output.
When looking at the button, it is an input. By default it is set to control the
NeoPixel lights.
Pressing the User Button will block communication to the NeoPixel lights while it
is pressed. This does not harm the button, the NeoPixels, or Ringo’s brain, but it
is something you should be aware of. We’ve provided two simple functions that
can be used to change the mode of this line as follows:
Note that SwitchButtonToPixels() is called automatically with all of the light
functions, so it is not necessary to call it explicitly.
SwitchPixelsToButton(); //use this function before reading button
SwitchButtonToPixels(); //use this function to resume pixel operation
If you spend more than five minutes learning how to code, you will find your
patience tested. Writing code is really pretty simple, but there is a small catch.
Computers expect to see instructions formatted a very specific way. There are
different rules in each computer language that must be followed. A piece of
software that runs in the background on your computer (called a “compiler”) reads
your code and turns it into a bunch of 1’s and 0’s that make sense to Ringo’s brain.
The it is very easy to make the compiler grumpy, in which case it will throw a fit and
refuse to do what it’s told. The solution to keeping it happy is to pay close attention
to how you format your code. Here are some common mistakes you may be making,
and how to correct them.
It no workey. (Sad Ringo).
SetPixelRGB( 1, 120, 50, 90); //correct upper-lowercase function. This works.
setpixelRGB( 1, 120, 50, 90); //no workey
setpixelrgb( 1, 120, 50, 90); //no workey
SETPIXELRGB( 1, 120, 50, 90); //no workey
delay(100);
//correct delay. This works.
Delay(100);
//no workey