1. I had programmed my Hello LED board to turn on when the button was pressed in Week 6 using Arduino.
2. Unfortunately, it did not work
reliably. Something weird was going on with the board-it required
pressure from the underside opposite the button to work.
3. I troubleshot using the multimeter
to ensure all the connections worked, there were no shorts, etc.
4. I also reflowed a bunch of the connections just in case.
5. I then attempted to remove the button on the theory that it was defective, and in the process ripped up the traces.
6. May re-mill and stuff the board in the future.
7. Used one of Anna's spare boards. It refused to flash through Arduino.
8. I re-installed Arduino, and it began
working.
9. Modified the script for different blink times (wait 2 seconds, blink for three, repeat cycle once):
/*
Button
Blinks twice, off for 2 seconds, on for 3.
const int buttonPin = 3; // the number of the pushbutton pin
const int ledPin = 7; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the
pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == LOW) {
delay(2000);//wait two seconds
// turn LED on:
digitalWrite(ledPin, HIGH);
delay(3000);
digitalWrite(ledPin, LOW);
delay(200);//wait two seconds
// turn LED on:
digitalWrite(ledPin, HIGH);
delay(300);
digitalWrite(ledPin, LOW);
}
}
10. A picture of the LED working:
11. I've also been building an Arduino over the last couple of weeks. Difficulties have arisen (primarily due to the small size of the traces for the 328 chip):
a) I attempted to use heat paste on the first iteration, which was a pain to apply. I then overheated the board and melted the plastic backing.
b)
The second iteration, which involved me soldering the chip on, has
adamantly refused to work. The bootloader loaded fine, but all
attempts to program the board were met with "stk_500 programmer
not responding" errors.
12.
Once I milled and stuffed my third Arduino and reinstalled the
Arduino IDE on my computer, it flashed fine. It is now totally
functional and is running my final project (see that page.)