Getting started with Arduino
The Arduino project was started at the Interaction Design Institute Ivrea (IDII) in Ivrea, Italy. At that time, the students used a BASIC Stamp microcontroller at a cost of $50, a considerable expense for many students. In 2003 Hernando Barragán created the development platform Wiring as a Master’s thesis project at IDII, under the supervision of Massimo Banzi and Casey Reas. The project goal was to create simple, low-cost tools for creating digital projects by non-engineers. The Wiring platform consisted of a printed circuit board (PCB) with an ATmega168 microcontroller, an IDE based on Processing and library functions to easily program the microcontroller. In 2005, Massimo Banzi, with David Mellis, another IDII student, and David Cuartielles; extended Wiring by adding support for the cheaper ATmega8 microcontroller. The new project, forked from Wiring, was called Arduino.
Source: Wikipedia.org
What is a Microcontroller?
A microcontroller is a compact integrated circuit designed to govern a specific operation in an embedded system. A typical microcontroller includes a processor; memory and input/output (I/O) peripherals on a single chip.
Source: internetofthingsagenda.techtarget.com
Arduino as a Microcontroller board:
The heart of the Arduino boards is an MCU (Microcontroller Unit) which does all the processing. The Uno board can be powered either by an external power supply from 7 – 12V DC or by using the USB – A cable itself (5V).
An MCU has to be programmed in order to do a specific task. This can be done using the Arduino IDE; Online web-editor or other IDEs.
Let’s get started:
Step 1: Choose your Editor
Code online on the Arduino Web Editor
If you have a reliable Internet connection, you should use the online IDE (Arduino Web Editor). It will allow you to save your sketches in the cloud. Having them available from any device and backed up. You will always have the most up-to-date version of the IDE without the need to install updates or community generated libraries.
To use the online IDE simply follow these instructions. Remember that boards work out-of-the-box on the Web Editor. You only need to install Arduino Create Agent to get started.
Download the Arduino IDE
Or the latest version of the IDE can be downloaded from the official website.
Link: https://www.arduino.cc/en/main/software
Step 2: Connect the USB cable to the Arduino
Step 3: Verify if the device is detected or not
Open device manager in your PC and expand the ports, you should see that the Uno is detected, if not you need to install the required drivers.
Note: Most of the Arduino boards come with a sketch already programmed in them to blink the built-in LED (for testing purposes). Therefore you should see the amber-coloured LED blinking once you connect the board to the PC.
Step 4: Write your first sketch
- Open the Arduino IDE
- Open the Tools menu from the Menu bar
- Select “Arduino Uno” for the board and select the assigned COM port
- Enter the code given below into the editor
// the setup function runs once when you press reset or power the board
void setup()
{
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop()
{
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for half a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for half a second
}
Step 5: Compile your sketch
Hit the tick button (compile) in the top-left corner of the IDE, You should see that the code is compiled successfully without any errors
Step 6: Upload your first sketch!
Hit the right arrow button (upload) next to the upload button. Now while the code uploads, you should see the LED’s next to Tx and Rx blinking indicating data transfer between the board and the computer.
Congratulations 🎉
You have successfully uploaded your first sketch into the Uno!
If the LED was already blinking once you connected the board to your computer, you should notice that now the LED blinks faster as we’ve reduced the delay time by 500ms.
Foundations
The Foundations section gives you some specific knowledge about the principles and techniques that are behind the Arduino platform, its whole family of boards and the software you use to tell your boards what to do.
If you want to get some knowledge before you start using things, this is the right place. If you want to jump on tinkering with your board visit the Getting Started page.
Basics
- An introduction on what is Arduino and what I can use it for?
- The Arduino Uno Board anatomy.
- What is the Arduino Software (IDE) and how to change the default language? What is a Sketch and how does it work?
Microcontrollers
- Digital Pins: How the pins work and what it means for them to be configured as inputs or outputs.
- Analog Input Pins: Details about the analog-to-digital conversion and other uses of the pins.
- PWM: How the analogWrite() function simulates an analog output using pulse-width modulation.
- Memory: The various types of memory available on the Arduino board.
Do you want to develop further the Arduino Hardware, or just build an Arduino on a breadboard? Check out the Hacking section.
Programming
- Language Reference: Discover the what each term of the Arduino code language means.
- Variables: Understand how to define and use variables in a Sketch.
- Functions: Learn how to define and use functions in a Sketch.
- Library: Using and installing Arduino Libraries.
- Cores: Need to add a new board to the Arduino Software? Install the relate core and manage it.
- Vidor HDL basics: Learn the basics of FPGAs programming language.
Looking for help on how to extend the Arduino Software (IDE), like write your own Library? Check out the Hacking section.
Other Guides
- “Arduino!”: a Comic by Jody Culkin: What is an Arduino? It’s an open-source prototyping platform.
- Parallel to Serial conversion: Use a parallel to serial shift register if needing more digital input than there are on your Arduino.
- Serial to Parallel conversion: Use a serial to parallel shift register if needing more digital output than there are on your Arduino.
- Capacitance Meter: Demonstrates use of RC time constants to measure the value of a capacitor.
- Bit Mask: Learn how access specific bits in a byte of data.
Nano RP2040 Connect
Before we close off this look at Arduino we will also have a look at the latest change in the Arduino game: The Nano RP2040 Connect. The Nano RP2040 Connect is the feature packed Arduino Nano board built with Raspberry Pi’s new silicon.
The feature packed Arduino Nano RP2040 Connect brings the new Raspberry Pi RP2040 microcontroller to the Nano form factor. Make the most of the dual core 32-bit Arm® Cortex®-M0+ to make Internet of Things projects with Bluetooth and WiFi connectivity thanks to the U-blox® Nina W102 module. Dive into real-world projects with the onboard accelerometer, gyroscope, RGB LED and microphone. Develop robust embedded AI solutions with minimal effort using the Arduino Nano RP2040 Connect!
Raspberry Pi RP2040 Microcontroller | Python Support | Dual Core 32-bit Arm® Cortex®-M0+ | U-blox® Nina W102 |
The all-new low-cost Raspberry Pi silicon is the first microcontroller developed by the Raspberry Pi Foundation. | This board can be programmed with the Python programming language via the OpenMV IDE. | Get started with machine learning with TinyML, TensorFlow Lite or Edge Impulse thanks to the high performance energy efficient microprocessor clocked at 133 MHz. | The first and only RP2040 board with native Bluetooth and WiFi connectivity. |
ST LSM6DSOX 6-axis IMU | Omnidirectional Digital Microphone | Microchip ATECC608A Cryptographic Co-processor | Step down converter |
Combined accelerometer and gyroscope with a dedicated machine learning core. | The MP34DT05 microphone allows to capture and analyze sound in real time and can be used to create a voice interface for your project. | The powerful, low-power processor that is used in all MKR Family boards. | Achieve high efficiency and low noise over a wide input voltage range with the builtin switch mode power supply |
Getting Started With Nano RP2040
Downloading and Installing the Arduino IDE 2.0
In this tutorial, we will show how to download and install the Arduino IDE 2.0 on your Windows, Mac, or Linux computer.
You can easily download the editor from the Arduino Software page.
Requirements
- Windows – Win 10 and newer, 64 bits
- Linux – 64 bits
The Arduino IDE 2.0
The Arduino IDE 2.0 is an open-source project, currently in its beta-phase. It is a big step from it’s sturdy predecessor, Arduino IDE (1.8.13), and comes with revamped UI, improved board & library manger, autocomplete feature and much more.
Download the Editor
Downloading the Arduino IDE 2.0 is done through the Arduino Software page. Here you will also find information on the other editors available to use.
Installation
Windows
To install the Arduino IDE 2.0 on a Windows computer, simply run the file downloaded from the software page.
Follow the instructions in the installation guide. The installation may take several minutes.
You can now use the Arduino IDE 2.0 on your Windows computer!
Linux
To install the Arduino IDE 2.0 on Linux, extract the downloaded file into a desired folder. Extracting the file can be done in Linux by right-clicking on the downloaded file and then selecting the Extract here option:
Now, go to the folder where you extracted the contents to. Then, right-click inside the folder and then select the Open in Terminal option:
A new terminal window should open. To launch the IDE 2.0 editor type in the terminal:
./arduino-ide
You can now use the Arduino IDE 2.0 on your Linux computer!
In Linux, The Arduino IDE 2.0 must be launched through the terminal.
How to Upload a Sketch with the Arduino IDE 2.0
In the Arduino environment, we write sketches that can be uploaded to Arduino boards. In this tutorial, we will go through how to select a board connected to your computer, and how to upload a sketch to that board, using the Arduino IDE 2.0.
Verify VS Upload
There are two main tools when uploading a sketch to a board: verify and upload. The verify tool simply goes through your sketch, checks for errors and compiles it. The upload tool does the same, but when it finishes compiling the code, it also uploads it to the board.
A good practice is to use the verifying tool before attempting to upload anything. This is a quick way of spotting any errors in your code, so you can fix them before actually uploading the code.
Uploading a Sketch
Installing a core is quick and easy, but let’s take a look at what we need to do.
1. Open the Arduino IDE 2.0.
2. With the editor open, let’s take a look at the navigation bar at the top. At the very left, there is a checkmark and an arrow pointing right. The checkmark is used to verify, and the arrow is used to upload.
3. Click on the verify tool (checkmark). Since we are verifying an empty sketch, we can be sure it is going to compile. After a few seconds, we can see the result of the action in the console (black box in the bottom).
4. Now we know that our code is compiled, and that it is working. Now, before we can upload the code to our board, we will first need to select the board that we are using. We can do this by navigating to Tools > Port > {Board}. The board(s) that are connected to your computer should appear here, and we need to select it by clicking it. In this case, our board is displayed as COM44 (Arduino UNO).
5. With the board selected, we are good to go! Click on the upload button, and it will start uploading the sketch to the board.
6. When it is finished, it will notify you in the console log. Of course, sometimes there are some complications when uploading, and these errors will be listed here as well.
Congratulations, you have now uploaded a sketch to your Arduino board!
Resources
https://create.arduino.cc/projecthub/yeshvanth_muniraj/getting-started-with-arduino-bcb879