diff options
Diffstat (limited to 'docs/source/lang/setup.rst')
-rw-r--r-- | docs/source/lang/setup.rst | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/source/lang/setup.rst b/docs/source/lang/setup.rst new file mode 100644 index 0000000..6b142d2 --- /dev/null +++ b/docs/source/lang/setup.rst @@ -0,0 +1,34 @@ +.. _lang-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() + { + // ... + } + + + +.. include:: cc-attribution.txt |