Today I finished my first Meggy Jr program. The programming with the Arduino IDE was easy as expected. I wrote a simple Color Chooser application that let’s the user explore the variety of colors available on Meggy Jr. Meggy Jr’s <em>Simple Library</em> only knows 16 predefined colors. It is possible though to define more colors with the Method
EditColor(byte color, byte r, byte g, byte b) in which you simply specify the amount of red, green and blue you want in your final color. Each component takes a byte as input and therefore Meggy can display 4096 different colors, theoretically. In practice you will find that even small values for the blue component will make the resulting color blue.
In my last blog entry I mentioned that it is possibly to write data to the pc via a serial connection. The Color Chooser makes use of this feature and writes back the current color and its components to the pc so you can use the values in another project.
I made a video of the running application. The quality sucks, but you’ll get the idea:
During the programming I used the Meggy Jr Programming Guide, a pretty helpful document. You can get it at the Evil Mad Scientist Laboratories.
The sourcecode of this application is available as download.