arduino:arduino_crash_course:basic_interaction
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
arduino:arduino_crash_course:basic_interaction [2012/11/03 21:05] – mithat | arduino:arduino_crash_course:basic_interaction [2012/11/03 21:12] – [Polling versus interrupts] mithat | ||
---|---|---|---|
Line 9: | Line 9: | ||
In an interrupt scheme, the microcontroller does essentially nothing in its main loop, but it is directed to do something specific when an input source jostles it into action. | In an interrupt scheme, the microcontroller does essentially nothing in its main loop, but it is directed to do something specific when an input source jostles it into action. | ||
- | Of the two, polling is probably easier to get started with. Following is a simple example of using polling. | + | Of the two, polling is probably easier to get started with. You can use both techniques at the same time as well. |
+ | |||
+ | Following is a simple example of using polling. | ||
===== Switch-controlled LED ===== | ===== Switch-controlled LED ===== | ||
Line 100: | Line 102: | ||
<code c> | <code c> | ||
- | digitalWrite(pushButtonPin, | + | digitalWrite(pushButtonPin, |
</ | </ | ||
Line 146: | Line 148: | ||
void setup() { | void setup() { | ||
pinMode(pushButtonPin, | pinMode(pushButtonPin, | ||
- | digitalWrite(pushButtonPin, | + | digitalWrite(pushButtonPin, |
pinMode(ledPin, | pinMode(ledPin, | ||
} | } |
arduino/arduino_crash_course/basic_interaction.txt · Last modified: 2017/12/06 01:05 by mithat