Hardware Reference
In-Depth Information
Coding an LED flash on the FLORA
Now you should be able to upload a file. You can't use the earlier Blink example as we
don't have the same I/O pins. So, type the following code into the IDE interface:
// Pin D7 has an LED connected on FLORA.
// give it a name:
int led = 7;
// the setup routine runs once when you press RESET:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on
delay(100); // wait for a second
digitalWrite(led, LOW); // turn the LED off
delay(1000); // wait for a second
}
Tip
Downloading the example code
You can download the example code files for all the Packt topics you have purchased from
your account at http://www.packtpub.com . If you purchased this topic elsewhere, you can
visit http://www.packtpub.com/support and register to have the files e-mailed to you.
Don't worry about specific code details yet, but this code will flash the LED on FLORA.
Upload the code by clicking on the Upload button as follows:
Search WWH ::




Custom Search