You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learn/01.starting-guide/00.getting-started-arduino/getting-started-arduino.md
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -152,7 +152,7 @@ Which in decimal format is:
152
152
23667
153
153
```
154
154
155
-
This is a clever way of sending large amounts of data from one point to the other, by rapidly turning ON or OFF something. This particular operation is quite complex, and this is just a basic explanation of how a digital signal works.
155
+
This is a clever way of sending large amounts of data from one point to the other, by rapidly sending high & low signals. In order to interpret the data from the signals, we use [Serial Communication Protocols](#serial-communication-protocols).
156
156
157
157
### Sensors & Actuators
158
158
@@ -203,10 +203,12 @@ Sensors and actuators, are typically referred to as **inputs and outputs**. When
203
203
A basic example of this is a **button** and an **LED**. We can write a conditional that checks if a button is pressed, we should turn on the LED, and to turn it off if the button is not pressed. In an Arduino program, it looks like this:
204
204
205
205
```arduino
206
-
if(button == HIGH){ //check if state is high (button is pressed)
206
+
int buttonState = digitalRead(buttonPin); //read and store the button state (0 or 1)
207
+
208
+
if(buttonState == HIGH){ //check if state is high (button is pressed)
207
209
digitalWrite(LED, HIGH) //turn on LED
208
210
}
209
-
else{
211
+
else{
210
212
digitalWrite(LED, LOW); //turn off LED
211
213
}
212
214
```
@@ -278,11 +280,11 @@ The absolute minimum requirement of an Arduino program is the use of two functio
278
280
-`void setup()` - this function executes only once, when the Arduino is powered on. Here we define things such as the mode of a pin (input or output), the baud rate of serial communication or the initialization of a library.
279
281
-`void loop()` - this is where we write the code that we want to execute over and over again, such as turning on/off a lamp based on an input, or to conduct a sensor reading every X second.
280
282
281
-
The above functions are **always** required in an Arduino sketch, but you are of course able to add several more functions, which is very useful for longer programs.
283
+
The above functions are **always** required in an Arduino sketch, but you are of course able to add several more functions, which is useful for longer programs.
282
284
283
285
### The "Sketch"
284
286
285
-
In the Arduino project, a program is referred to as a "Sketch". A sketch is basically just a file that you write your program inside. It has the `.ino` extension, and is always stored in a folder of the same name.
287
+
In the Arduino project, a program is referred to as a "Sketch". A sketch is a file that you write your program inside. It has the `.ino` extension, and is always stored in a folder of the same name.
286
288
287
289
The folder can include other files, such as a **header file**, that can be included in your sketch.
288
290
@@ -342,6 +344,8 @@ To use a library, you need to include it at the top of your code, as the example
342
344
#include <Library.h>
343
345
```
344
346
347
+
Most libraries also have a set of examples that can be
348
+
345
349
***You can browse through all official and contributed libraries in the [Arduino Libraries page](https://www.arduino.cc/reference/en/libraries/).***
346
350
347
351
### Core Specific API
@@ -855,4 +859,4 @@ To learn more, you can explore the [Arduino Documentation](/) and the [Arduino L
855
859
856
860
To purchase an Arduino board, visit the [Arduino Store](https://store.arduino.cc/).
857
861
858
-
To download a version of the Arduino IDE, visit the [Arduino Software page]().
862
+
To download a version of the Arduino IDE, visit the [Arduino Software page](https://www.arduino.cc/en/software).
0 commit comments