arduino:arduino_crash_course:program_structure
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
arduino:arduino_crash_course:program_structure [2012/11/03 01:49] – mithat | arduino:arduino_crash_course:program_structure [2017/11/06 02:23] – mithat | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Main loop ===== | ===== Main loop ===== | ||
- | All Arduino programs | + | Arduino programs |
+ | |||
+ | Arduino sketches all have the same basic structure, consisting | ||
<file c program_structure.ino> | <file c program_structure.ino> | ||
Line 11: | Line 13: | ||
void loop() { | void loop() { | ||
- | // Stuff in here gets run over and over and over again (until you turn the power off). | + | // Stuff in here gets run over and over and over again |
+ | // (until you turn the power off). | ||
} | } | ||
</ | </ | ||
+ | Whatever you write in the body of the '' | ||
===== Blink an LED ===== | ===== Blink an LED ===== | ||
- | Blinking an LED is the microcontroller equivalent to a " | + | Blinking an LED is the microcontroller equivalent to a " |
<file c BlinkMe.ino> | <file c BlinkMe.ino> | ||
Line 74: | Line 78: | ||
// use variable ledPin to store the pin number that drives the LED | // use variable ledPin to store the pin number that drives the LED | ||
int ledPin = 13; | int ledPin = 13; | ||
+ | |||
// define the LED's on and off times in milliseconds | // define the LED's on and off times in milliseconds | ||
int onTime = 1000; | int onTime = 1000; |
arduino/arduino_crash_course/program_structure.txt · Last modified: 2017/12/06 01:01 by mithat