Prototyping
The arduino protoshield kit seemed an ideal starting point as it had the headers to wire up the digital inputs and outputs and an area to layout components and a few components to wire up some simple circuits.
There are some really nice design features of the PCB such as mirroring the reset switch and ICSP pinouts as those are blocked by the position of the shield. There is also an area for prototyping with SMD chips as well as a for chips in DIP format.
You can download the schematic and Eagle PCB design files from the Arduino site:
http://arduino.cc/en/Main/ArduinoProtoShield
Given that the kit came with red, yellow and green LEDs I could not resist making a simple traffic light. So I wired up the three LEDs with the supplied 220ohm resistors and put together the following simple programme. Obviously if you were programming a real traffic light you’d want to put in bigger delays and also look at adding traffic sensors etc. I’d also suggest switching from this simple structure to something like a finite state machine.
- /*
- Traffic Lights
- Three LEDs wired to digital outputs as specified below
- */
- const int Green = 8;
- const int Amber = 9;
- const int Red = 10;
- void setup() {
- // initialize the digital pin as an output.
- pinMode(Green, OUTPUT);
- pinMode(Amber, OUTPUT);
- pinMode(Red, OUTPUT);
- }
- void loop() {
- digitalWrite(Red, HIGH);
- delay(1000);
- digitalWrite(Amber, HIGH);
- delay(1000);
- digitalWrite(Red, LOW);
- digitalWrite(Amber, LOW);
- digitalWrite(Green, HIGH);
- delay(1000);
- digitalWrite(Amber, HIGH);
- digitalWrite(Green, LOW);
- delay(1000);
- digitalWrite(Amber, LOW);
- }
I’ll remove these temporary components before connecting up and writing code to interface to the LCD, so hopefully more on this project soon.
[…] my prototyping on the Arduino there’s been an update to the Arduino development software. A couple of the […]