while(button_not_pressed) {} //wait here until button is pressed
This is the 3rd most common source of grief!while(button_not_pressed) {yield()} //wait here until button is pressed
Pin number |
Function |
GPIO0 |
Button, white led, & boot
mode |
GPIO2 |
DS18B20 |
GPIO12 |
SCL |
GPIO13 |
SDA |
GPIO14 |
DHT11 |
GPIO16 |
Relay |
/* Blink revisited */
#define LED 0 //LED is conneceted to GPIO0
boolean LEDSTATE=0;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin as an output.
pinMode(LED, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED, LEDSTATE); // LED on/off
delay(1000); // wait for a second
LEDSTATE^=1; //toggle the state
}
When successfully
loaded this program should flash the white LED on & off.