Exercise 1: Mega2560 Interface
List group members:
Instructions: as you complete each component, demonstrate to the
instructor or the TA and have them sign off on it.
C Development Environment
Note: Each person on team must be signed off on this step.
Write a program to flash the LED attached to PORTB, pin 7 at a
frequency of 3 Hz.
- For Windoze: Configure AVR studio for connecting to the mega2560
- For Linux/OSX: Use the provided makefile
- Hardware: Double-stick tape your Arduino board to the prototype
board (use a small amount of tape). Connect +5V power and
ground to the power and ground busses on the protoboard
- Hardware: Connect at least four LEDs to different outputs (it is best if
these are on the same port and contiguous pins)
- Software: Write a test program that shows that all LEDS work
independently of one-another
- Software: Write a program that displays an interesting sequence
of LED patterns
- Hardware: Connect another pin on the same port to +5V through a
resistor. Connect this same pin through a "switch"
directly to ground. In this case, our switch is two pieces of
wire: one connected to ground, the other to the pin. To
"close" the switch, we simply touch the two wires together.
- Software: augment your above program so that it does not start
the LED sequence until after you close the switch
- User sees 2 LED flashes
- The code waits for a random delay (use "random()" to draw a number)
- The code flashes once more
- If the user responds by closing the switch within 100 ms, then
light one LED
- If the user responds within 150 ms, then light two LEDs
- After opening the switch, the game starts over.
Before You Leave...
Hand in this sheet
Last modified: Tue Feb 22 00:19:16 2011