Arduino
What is Arduino
Arduino is an open-source electronics platform based on easy-to-use hardware and software designed to create interactive projects. It consists of a physical programmable circuit board and a software environment (IDE) where you write and upload code to the controller. By receiving inputs from sensors or switches you can control various outputs like motors, lights, displays to interact with the physical world. Arduino was developed in 2005 at the Interaction Design Institute Ivrea (IDII) in Italy.
Arduino offers a broad variety of different microcontrollers. In our course we are using the Arduino Uno:

#Digital Pins
- digitalWrite(pin,LOW) sets the pin LOW= 0V and digitalWrite(pin, HIGH) sets the pin HIGH= 5V, if configured a an OUTPUT pinMode(pin, OUTPUT)
#Analog Pins
- use analogRead() command to encode the voltage range from 0 to 5 volts to a numerical range from 0 to 1023 in a process referred to as analog-to-digital conversion, or ADC.
- use digitalRead() or digitalWrite() to be able to use the analog pins as general purpose input/output (GPIO) like a digital pin
#PWM Pins
PWM pins are denoted with a tilde sign (~).
A call to analogWrite() is on a scale of 0 - 255, such that analogWrite(255) sets an LED to full brightness and analogWrite(127) sets an LED to 50% brightness.
Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. If you repeat this on-off pattern fast enough with an LED for example, the result is as if the signal is a steady voltage between 0 and 5V controlling the brightness of the LED.
Detailed explanation here.
Set up
Software
Install the Arduino IDE (Integrated Development Environment) here. Select the operating system of your laptop and click the Download button.
Hardware
Connect the Arduino board to the laptop using the USB B cable plus adapter if needed.
Interface

1 VERIFY: verify you code before uploading it, correct errors if indicated
2 UPLOAD: Upload your code to your microcontroller
3 PORT: Select the USB port, where you connected your microcontroller
4 SERIAL PLOTTER: Opens serial plotter
5 SERIAL MONITOR: Opens serial monitor
6 SKETCHBOOK: Shows recently saved sketches
7 BOARDS MANAGER: Install new board here
8 LIBRARY MANAGER: Install libraries here
9 DEBUG: Helps debugging
11 CLOUD: Sign in to Arduino cloud
12 VOID SETUP: Put your setup code here to run once
13 VOID LOOP: Put you main code here to run repeatedly