Training on Arduino
Lecture 1 (Introduction to Arduino)
Intruduction
PWTo
Arduino M
Arduino is an open-source electronics
platform based on easy-to-use hardware and
software.
Arduino boards are able to read inputs - light on a
sensor, a finger on a button, or a Twitter message
- and turn it into an output - activating a motor,
turning on an LED, publishing something online.
Arduino
PWFamily
M
Arduino UnoPWM
Pin Configuration
Arduino Uno Specification
Microcontroller ATmega328p
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limit) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
PWM Digital I/O Pins 6
Analog Input Pins 6
DC Current per I/O Pin 20 mA
DC Current for 3.3V Pin 50 mA
32 KB (ATmega328P) of which 0.5 KB used
Flash Memory by bootloader
SRAM 2 KB (ATmega328P)
EEPROM 1 KB (ATmega328P)
Clock Speed 16 MHz
Basic structure
PWM of a sketch
A sketch can be divided in three parts.
1. Name variable
In the first part elements of the program are named ( This
will be explained in program no. This part is not
absolutely necessary.
2. Setup (absolutely necessary for the program)
The setup will be performed only once. Here you are
telling the program for example what
Pin (slot for cables) should be an input and what should be
an output on the boards.
3. Loop (absolutely necessary for the program)
This loop part will be continuously repeated by the board. It
assimilates the sketch from beginning to end and starts
again from the beginning and so on.
Basic Example
PWM Code
Arduino
PWMBlink