diff options
Diffstat (limited to 'source/arduino/setup.rst')
-rw-r--r-- | source/arduino/setup.rst | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/arduino/setup.rst b/source/arduino/setup.rst new file mode 100644 index 0000000..05911ed --- /dev/null +++ b/source/arduino/setup.rst @@ -0,0 +1,31 @@ +.. _arduino-setup: + +setup() +======= + +The setup() function is called when a sketch starts. Use it to +initialize variables, pin modes, start using libraries, etc. The +setup function will only run once, after each powerup or reset of +the Arduino board. + + + +Example +~~~~~~~ + +:: + + + int buttonPin = 3; + + void setup() + { + Serial.begin(9600); + pinMode(buttonPin, INPUT); + } + + void loop() + { + // ... + } + |