3. TECHNICAL SPECS...
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
Flash Memory 32 KB (ATmega328P) of which 0.5 KB used by
bootloader
SRAM 2 KB, EEPROM 1 KB
Clock Speed 16 MHz
3
5. The ATmega328 on the Uno comes pre-programmed with a
bootloader that allows you to upload new code to it without the
use of an external hardware programmer.
It communicates using the original STK500 protocol, & C
header files, we can also bypass the bootloader using ICSP
header and Arduino ISP.
The Uno has a resettable polyfuse that protects computer's
USB ports from shorts and over current. If more than 500 mA
is applied to the USB port, the fuse will automatically break the
connection until the short or overload is removed.
5
6. The ATmega328 provides UART serial communication
using Rx and Tx pins. Atmega 16U2 communicated with
PC using the serial communication by via USB port
acting as a virtual Com port for serial communication
Also support ICSP and SPI communication
6
10. ARDUINO IDE -SKETCH
void setup()
{
// put your setup code here, to run once:
}
void loop()
{
// put your main code here, to run repeatedly:
}
10
11. DIGITAL I/O
ONLY HIGH AND LOW VALUES
pin configuration to do input or output
Syntax: pinMode(pinNumber, pinState)
Ex. pinMode(13, INPUT)
pinMode(13, OUTPUT)
I/O Pin control
Syntax: digitalWrite(pinNumber, HIGH/LOW)
Ex. digitalWrite(8, HIGH)
Syntax: int val = digitalRead(pinNumber)
Ex. int val = digitalRead(4) 11
12. The Arduino language is CASE SENSITIVE
Almost every line of code needs to end with a semicolon ‘;’
Single line comment: //abcd.....
Multiline comments: /*abcd....*/
The void setup() section is used to initialize variables, pin
modes, set the serial baud rate and related.
The void loop() section is the part of the code that loops back
onto itself and is the main part of the code Note
We are free to add subroutines using the same syntax:
void subroutinename() { }
12
13. Workbook 01:
1. Program to implement a running LED using Digital
I/O pins.
(pin No13???)
Workbook 02:
2. Program to read the status of digital input pin and
show it in another pin using LED
13
14. PROCEDURE & PROCEDURE CALLS
Procedure is a collection of statements, its used to group
statements together so that we can refer to them all with
one name.
Procedure Calls
Delay(1000);
Special Procedures
Setup()
Loop()
14