![]() |
ANU College of Engineering and Computer Science
Research School of Computer Science
|
|
|
Meggy Jr RGB Example CodeThe main aim of these examples is to help students get started on programming the Meggy Jr RGB. I would encourage people to read through, understand, compile, load, and modify each of the example programs provided. Also the circuit diagram and the library code for arduino development environment are helpful in working out how to control the Meggy (these are available from the link above).The examples are availalbe from: example downloads.
tone.cThis is the simplest program to get working on the Meggy. It basically involves toggling the pin connected to the speaker at a fixed rate. Don't run it for to long it is very annoying.lights.cThis changes the lights at the top of the meggy along with one column of the display. The ICs that drive the LEDs are set by serially shifting the values into them. The great thing about the AVR is that this is very simple as once setup the value you wish to shift into the LED drivers can be placed into a register and the AVR does the rest (just poll for this shift to be complete).screen.cThis extends lights.c by creating a frame buffer and switching between the different columns of the screen to give the appearance of all the LED being on at the same time. I seem to have some error in the code with one column not working. See if you can work out what the problem is!serialout.cThis shows how character output can be sent via the serial cable. This may be useful for doing some debugging.keys.cThis shows how input from the keyboard can be obtained. This basically involve looking at values of the accociated pins on the AVR.interrupt.cUsing interrupts to create a tone.scribble.cA simple drawing program. Combines code from screen.c and keys.c to create an interactive program. | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Please direct all enquiries to: ericm@cs.anu.edu.au Page authorised by: Head of School, RSoCS |
| The Australian National University — CRICOS Provider Number 00120C |