aboutsummaryrefslogtreecommitdiffstats
path: root/source/arduino/volatile.rst
diff options
context:
space:
mode:
Diffstat (limited to 'source/arduino/volatile.rst')
-rw-r--r--source/arduino/volatile.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/arduino/volatile.rst b/source/arduino/volatile.rst
index 9516db0..fc02081 100644
--- a/source/arduino/volatile.rst
+++ b/source/arduino/volatile.rst
@@ -39,21 +39,21 @@ Example
::
// toggles LED when interrupt pin changes state
-
+
int pin = 13;
volatile int state = LOW;
-
+
void setup()
{
pinMode(pin, OUTPUT);
attachInterrupt(0, blink, CHANGE);
}
-
+
void loop()
{
digitalWrite(pin, state);
}
-
+
void blink()
{
state = !state;
@@ -70,4 +70,4 @@ See also
-.. include:: cc-attribution.txt \ No newline at end of file
+.. include:: cc-attribution.txt