Download presentation
1
Arduino
2
What is Arduino Arduino is not a Microcontroller. Arduino is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a MC) and a piece of software, or IDE (Integrated Development Environment) that runs on a host system(computer).
3
What is the Arduino
4
Programmer
6
The Arduino Development Board
Making-robots-with-arduino.pdf
7
Features of Arduino UN0 Microcontroller-ATmega328
Operating Voltage 5V and 3.3 V Input Voltage (recommended) 7-12V Input Voltage (limits) 6-20V Digital I/O Pins -14 (of which 6 provide PWM output) Analog Input Pins-6 DC Current per I/O Pin-40 mA DC Current for 3.3V Pin-50 mA Flash Memory-32 KB (ATmega328) SRAM-2 KB (ATmega328) EEPROM-1 KB (ATmega328) Clock Speed-16 MHz
8
Arduino Pins
9
Cont.… Analog pins-6 Power Pins Vin 5V GND 3.3V Other Pins AREF RESET
A0-A5 Power Pins Vin 5V GND 3.3V Other Pins AREF RESET Digital pins-14 Serial: 0 (RX) and 1 (TX) External Interrupts: 2 and 3. PWM: 3, 5, 6, 9, 10, and 11 BT Reset: 7 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). Led 13 Pin 8
10
Arduino is a platform The Arduino Software (IDE) allows you to write programs and upload them to your board. The language itself is based in C.
11
Connect the USB Cable
12
Functions There are 9 important functions in Arduino platform.
PinMode(pin, mode); Configures a digital pin to read (input) or write (output) a digital value. DigitalRead(pin); Reads a digital value (HIGH or LOW) on a pin set for input. DigitalWrite(pin, value); Writes the digital value (HIGH or LOW) to a pin set for output.
13
Functions analogRead(pin):Reads the value from the specified analog pin. analogWrite():Writes an analog value to a pin. Serial.println(value):Prints the value to the Serial Monitor on your computer. Serial.begin(baud rate):Sets the data rate in bits per second (baud) for serial data transmission.
14
Arduino IDE
15
Select Serial Port and Board
17
Status Messages
18
Overview of The C Programming Language
19
About Programming Code is case sensitive
Statements are commands and must end with a semi-colon Comments follow a // or begin with /* and end with */ Loop and Setup
20
Terminology
21
Example 1 Demonstration Start up the Arduino software and open up the Blink sketch. For the most basic kind of program you’ll need a simple actuator, an LED with the long leg(Anode +) pushed into pin 13 and the short leg (Cathode -) in the adjacent ground pin (GND). Pin 13 is special, in the sense that it has a built in resistor to correctly control the voltage going into a testing LED just like this.
22
Add an External LED to pin 13
File > Examples > Digital > Blink LED’s have polarity Negative indicated by flat side of the housing and a short leg
23
Our First Program
24
Code Structure: Header
Example 1 Code Structure: Header Header provides information
25
Code Structure: setup function
Example 1 Code Structure: setup function setup function is executed only once at the start
26
Code Structure: loop function
Example 1 Code Structure: loop function loop function is repeated indefinitely
27
Code prepare pin 13 for outputs of voltage Example 1
pinMode(13, Output) prepare pin 13 for outputs of voltage
28
Code Sets pin 13 to a voltage that means “on” Example 1
digitalWrite(13, HIGH) Sets pin 13 to a voltage that means “on”
29
Code Tells microcontroller to do nothing for 1000 ms = 1 s Example 1
delay(1000); Tells microcontroller to do nothing for 1000 ms = 1 s
30
Code Sets pin 13 to voltage that means “off” Example 1
digitalWrite(13, LOW) Sets pin 13 to voltage that means “off”
31
Example 1 The connections
32
Upload a program At this stage we just programmed the LED to blink on and off at a set time interval. Press the reset button on the board and then click ‘Upload to I/O board’ in the IDE. If all goes well lights should flicker on the board and the IDE will confirm success.
33
Advantages of Arduino Open source
Simplified and user-friendly programming language No additional programmer/burner hardware required for programming board Portable Low power consumption
34
Applications of Arduino
Home Automations Sensor prototyping Robotics ISP programming Easy Wifi ,Gsm ,Ethernet , Bluetooth , zigbee Conectivity
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.