aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/lang/setup.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/source/lang/setup.rst')
-rw-r--r--docs/source/lang/setup.rst27
1 files changed, 11 insertions, 16 deletions
diff --git a/docs/source/lang/setup.rst b/docs/source/lang/setup.rst
index 6b142d2..837ddd6 100644
--- a/docs/source/lang/setup.rst
+++ b/docs/source/lang/setup.rst
@@ -1,34 +1,29 @@
+.. highlight:: cpp
+
.. _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.
-
-
+The ``setup()`` function is called when a sketch starts. Use it to
+initialize :ref:`variables <lang-variables>`, :ref:`pin modes
+<lang-pinmode>`, start using :ref:`libraries <libraries>`, etc. The
+``setup()`` function will only run once, after each power-up or reset
+of the Maple board.
Example
-~~~~~~~
+-------
::
+ int buttonPin = 38;
- int buttonPin = 3;
-
- void setup()
- {
- Serial.begin(9600);
+ void setup() {
pinMode(buttonPin, INPUT);
}
- void loop()
- {
+ void loop() {
// ...
}
-
-
.. include:: cc-attribution.txt