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
The Arduino platform has since its start in 2005, grown to become one of the most recognizable brands in the space of electronics and embedded design.
@@ -11,11 +12,11 @@ But what are the cornerstones of Arduino? What is a "board", how do I write code
11
12
***In this guide, you will discover a lot of topics related to the Arduino Ecosystem, and links that lead to more in-depth articles.***
12
13
13
14
14
-
## [Overview](#overview)
15
+
## Overview
15
16
16
17
This guide is divided into four main sections: **hardware**, **software tools**, **Arduino API**, and **Quick Reference**. You can navigate to each of these sections directly through the links below:
17
18
18
-
### [Arduino Hardware](#arduino-hardware)
19
+
### Arduino Hardware
19
20
20
21
In this section, we will dedicate some time to learn about some fundamentals in electronics, and about a basic operation of an Arduino board.
21
22
@@ -31,7 +32,7 @@ In this section, we will dedicate some time to learn about some fundamentals in
31
32
-[Embedded Components](#embedded-components)
32
33
-[Internet of Things (IoT)](#internet-of-things-iot)
33
34
34
-
### [Arduino API](#arduino-api)
35
+
### Arduino API
35
36
36
37
In this section you will learn what the Arduino API is, and how to create code that can run on your Arduino board.
37
38
@@ -42,7 +43,7 @@ In this section you will learn what the Arduino API is, and how to create code t
In this section you will how to set up your development environment as well as learning about what options there are.
48
49
@@ -54,7 +55,7 @@ In this section you will how to set up your development environment as well as l
54
55
-[Library Manager](#library-manager)
55
56
-[Arduino CLI](#arduino-cli)
56
57
57
-
### [Quick Reference](#quick-reference)
58
+
### Quick Reference
58
59
59
60
The quick reference is an extract from the full Arduino API, containing popular functions, structures and methods.
60
61
@@ -63,47 +64,6 @@ The quick reference is an extract from the full Arduino API, containing popular
63
64
-[GPIO / Pin Management](#gpio--pin-management)
64
65
-[Structure](#structure)
65
66
66
-
67
-
68
-
69
-
## Overview
70
-
71
-
This guide is divided into three main sections: **hardware**, **software tools**, and **Arduino API**. The sections just below summarizes the learning outcome of this article:
72
-
73
-
### [Hardware](#arduino-hardware)
74
-
75
-
In this section, we will dedicate some time to learn about some fundamentals in electronics, and about a basic operation of an Arduino board.
76
-
77
-
- The anatomy of an Arduino board.
78
-
- The "basic" operation of an Arduino board.
79
-
- Fundamental knowledge of microcontrollers, electronic signals, communication protocols, memory management.
80
-
- Embedded sensors.
81
-
- Creating a circuit with external sensors and actuators.
82
-
- Internet of Things (IoT) and different radio modules & wireless protocols.
In this section you will how to set up your development environment as well as learning about what options there are.s
87
-
88
-
- How to set up your development environment.
89
-
- Learn about the Arduino IDEs (Integrated Development Environment).
90
-
- Learn about the Arduino Cloud Service.
91
-
- Intro to the Arduino CLI (Command Line Interface).
92
-
93
-
### [The Arduino API](#arduino-api)
94
-
95
-
In this section you will learn what the Arduino API is, and how to create code that can run on your Arduino board.
96
-
97
-
- What is the "Arduino API".
98
-
- How is an Arduino program (sketch) structured.
99
-
- How do I upload code to an Arduino board?
100
-
- What is a "core/platform"?
101
-
- Core specific API.
102
-
103
-
### [Quick Reference](#quick-reference)
104
-
105
-
- General
106
-
107
67
## Arduino Hardware
108
68
109
69
Over the years, Arduino has released hundreds of hardware designs in many shapes and forms.
@@ -196,17 +156,23 @@ This is a clever way of sending large amounts of data from one point to the othe
196
156
197
157
### Sensors & Actuators
198
158
199
-
When working with Arduino, it is important to understand **sensors** and **actuators**.
159
+
When working with Arduino, it is important to understand **sensors** and **actuators**, and the difference between them.
200
160
201
161
#### What Is a Sensor?
202
162
203
-
A sensor, in simple terms, is used to *sense* its environment, meaning it records a physical parameter, for example temperature, and converts it into a signal.
163
+
A sensor, in simple terms, is used to *sense* its environment, meaning it records a physical parameter, for example temperature, and converts it into an electronic signal.
204
164
205
-
Sensors can also take the form of just a simple button: when a state changes (we press the button), and electronic signal is switched from low to high (0 to 1).
165
+
Sensors can also take the form of just a simple button: when a state changes (we press the button), the electronic signal is switched from low to high (0 to 1).
206
166
207
167
There are many types of sensors, and several ways of recording data from them. Perhaps the easiest to use is an analog sensor, where we record the voltage input (usually between 0-5 volts). This simply gives you a range between 0-1023 (a 10-bit resolution).
208
168
209
-
Digital sensors are a bit more advanced, depending on the type. They rely on [Serial Communication Protocols](#serial-communication-protocols) to send the data accordingly, and requires a bit more effort to translate the data. As mentioned in the [Electronic Signals](#electronic-signals) section above, data is sent using a binary sequence (e.g. `101101` is `45`), and this needs to be addressed and configured on a software level. Luckily, a lot of sensors are accompanied by **libraries**, which makes it a lot easier to read.
169
+
Digital sensors are a bit more advanced, depending on the type. They rely on [Serial Communication Protocols](#serial-communication-protocols) to send the data accordingly, and requires a bit more effort to translate the data. As mentioned in the [Electronic Signals](#electronic-signals) section above, data is sent using a binary sequence (e.g. `101101` is `45`), and this needs to be addressed and configured on a software level. Luckily, a lot of sensors are accompanied by **software libraries**, which makes it a lot easier to read.
170
+
171
+
In many cases, all we need is just one line of code:
172
+
173
+
```arduino
174
+
sensorValue = sensor.read();
175
+
```
210
176
211
177
#### What Is an Actuator?
212
178
@@ -220,6 +186,16 @@ Actuators converts electric signals into e.g. radiant energy (light) or mechanic
220
186
221
187
How actuators are controlled really depends on what type of component we have. The most simple way is to simply turn something on/off, while more advanced is controlling the amount of voltage a component gets (i.e. the speed of a motor).
222
188
189
+
To control actuators, it is common to use `digitalWrite()` and `analogWrite()`.
190
+
191
+
```arduino
192
+
digitalWrite(LED, HIGH); //turn on an LED
193
+
digitalWrite(LED, LOW); //turn off an LED
194
+
195
+
analogWrite(motor, 255); //set a motor to maximum capacity
196
+
analogWrite(motor, 25); //set a motor to 10% of its capacity
197
+
```
198
+
223
199
#### Input & Output
224
200
225
201
Sensors and actuators, are typically referred to as **inputs and outputs**. When we write a program, it is common to construct conditionals that checks the state of a sensor, and decides whether it should actuate something.
@@ -253,24 +229,25 @@ The SRAM (Static Random-Access Memory) is used to for example store the value of
253
229
254
230
The Flash memory is primarily used to store the main program, or the instructions for the microcontroller. This memory is not erased when powered off so that the instructions for the microcontroller are executed as soon as the board is powered.
255
231
232
+
How much memory is available on an Arduino varies from board to board. For example the **Arduino UNO** has a 32kB flash / 2kB SRAM, while a **Nano 33 IoT** has 256kB flash / 32kB SRAM. You will find this information in each of the product's documentation pages, which are available in the [Arduino Hardware Documentation](/).
233
+
256
234
***To learn more about memory on an Arduino, visit the [Arduino Memory Guide](/learn/programming/memory-guide).***
257
235
258
-
### Embedded Components
236
+
### Embedded Sensors
259
237
260
238

261
239
262
-
An **embedded component** is a tiny component that is found on your board. As electronics are getting smaller and smaller, more and more can be fitted to smaller circuit boards.
263
-
264
-
Many new Arduino boards have sensors embedded directly, making them very compact. For example, the [Nano BLE Sense]() has 7 embedded sensors, but is only **45x18mm** (the size of a thumb). These are all connected via the I²C protocol as mentioned above, and has a unique address.
265
-
240
+
Many new Arduino boards come equipped with **embedded sensors**. For example, the [Nano BLE Sense](https://store.arduino.cc/products/arduino-nano-33-ble-sense) has 7 embedded sensors, but is only **45x18mm** (the size of a thumb). These are all connected via the I²C protocol as mentioned above, and has a unique address.
266
241
267
242
### Internet of Things (IoT)
268
243
269
-
Most modern Arduino boards now come equipped with a radio module, designed to communicate wirelessly. There are several different ones: Wi-Fi, Bluetooth, LoRa, GSM, NB-IoT and more. Each are designed to communicate using the various technologies available on the market.
244
+
Most modern Arduino boards now come equipped with a radio module, designed to communicate wirelessly. There are several different ones: Wi-Fi, Bluetooth®, LoRa®, GSM, NB-IoT and more. Each are designed to communicate using the various technologies available on the market.
245
+
246
+

270
247
271
-
The most popular and inexpensive modules are the Wi-Fi & Bluetooth modules. The Wi-Fi modules allow your board to connect to routers, and to request and send data over the Internet. In a way, it works the same as your computer when requesting various types of data over the Internet, just in a smaller scale.
248
+
The most popular and inexpensive modules are the Wi-Fi & Bluetooth® modules. The Wi-Fi modules allow your board to connect to routers, and to request and send data over the Internet. In a way, it works the same as your computer when requesting various types of data over the Internet, just in a smaller scale.
272
249
273
-
Bluetooth is used to communicate with nearby devices, and is really useful for maintaining a fast and reliable connection. For example, in real-life applications, Bluetooth is used for wireless headphones & speakers.
250
+
Bluetooth® is used to communicate with nearby devices, and is really useful for maintaining a fast and reliable connection. For example, in real-life applications, Bluetooth® technologty for example used in wireless headphones & speakers.
274
251
275
252
Similarly to serial protocols, radio modules use their own set of protocols to communicate, such as HTTP, MQTT and UPD.
276
253
@@ -449,7 +426,7 @@ The [Arduino Web Editor](https://create.arduino.cc/editor) is an online IDE, par
449
426
450
427
### Library Manager
451
428
452
-
![The Library Manager.]()
429
+

453
430
454
431
Every version of the IDE has a library manager for installing Arduino software libraries. Thousands of libraries, both official and contributed libraries, are available for direct download. Code examples for each library is made available on download.
455
432
@@ -680,10 +657,16 @@ void loop() {
680
657
}
681
658
```
682
659
683
-
#### `Serial.available()`
684
-
685
660
#### `Serial.read()`
686
661
662
+
Reads the incoming serial data.
663
+
664
+
```arduino
665
+
void loop() {
666
+
int incomingByte = Serial.read();
667
+
}
668
+
```
669
+
687
670
### GPIO / Pin Management
688
671
689
672
Configuring, controlling and reading the state of a digital/analog pin on an Arduino.
@@ -871,3 +854,5 @@ In this guide, we have touched upon some of the fundamentals of Arduino: hardwar
871
854
To learn more, you can explore the [Arduino Documentation](/) and the [Arduino Language Reference](https://www.arduino.cc/reference/en/), where you will discover thousands of detailed tutorials, examples, API entries and other resources.
872
855
873
856
To purchase an Arduino board, visit the [Arduino Store](https://store.arduino.cc/).
857
+
858
+
To download a version of the Arduino IDE, visit the [Arduino Software page]().
0 commit comments