arduino day 1 presentation
Post on 14-May-2015
968 Views
Preview:
DESCRIPTION
TRANSCRIPT
GETTING STARTED IN
ARDUINO PLATFORM
ORGANIZED BY:DIGITRONIX, WRC
ww
w.d
igitro
nix
nepal.b
log
spot
.com
INTRODUCTION TO ARDUINO
- Open Source Hardware and Software Platform
-Self Contained Computer in an IC
=INTEL 286
Arduino Diecimila
INTRODUCTION TO ARDUINO
- Based on AVR microcontrollers that are widely popular for their RISC architecture, hight flash memory, inbuilt different features
- Arduino Uses C programming(E A S Y)……
WHY ARDUINO?
- Inbuilt ADC, Serial Interface, PWM, IO pins
-Programming so easy……(Can be used available libraries)
-Open Source platform
HARDWARE
I/O PORTS ========== 14PWM ========== 6Analog ========== 6
8 bit =======25610 bit ======= 1023
ADC
DIFFERENT B0ARDS
DUE
ELEVEN
UNO
DIFFERENT B0ARDS
DUE
LILYPAD MEGANANO
SOFTWARE REQUIREMENTS
Arduino IDE
Serial Port Driver
ARDUINO PROGRAMMING BASICS
Void setup(){//your initialization code}
GLOBAL Variables1.
2.
Void loop(){//your repeating code}
3.
Global VariablesInteger====int
Character====charString====string
Boolean====boolean
int ledInput=13; //pin 13 is ledIput
EXAMPLE:
Setup()Put the code
for the initialization
Example
void setup(){Serial,begin(9600); //serial port baudrate=9600bpspinMode(ledInput, output); // configure pin 13 as output
port}
loop()Put the code
that is required to be performed by
System.Example
void loop(){digitalWrite(ledinput, high); //led=ondelay(500);digitalWrite(ledinput, low); //led=offdelay(500);}
Functions used in setup()1. pinMode(13, OUTPUT); makes pin 13 as output pin2. pinMode(8, INPUT); makes pin 8 as input pin3. Serial.begin(9600) ; starts serial communication with Baudrate 9600Functions used in loop()1. digitalWrite(13, HIGH): makes pin 13 high ie pin13=ON;2. delay(500) : delays system by 500 ms.3. analogRead() : Reads analog value4. analogWrite() : writes anlog value(PWM)5. Serial.print() : Prints at serial monitor6. Serial.println() : prints at serial monitor with line break
WRITE Down!
EXERCISE:Write the code and implement:1. One led blinking at each 1s.2. A led with ON time=600ms and OFF time=900ms3. You are given 6 leds. Now light these leds in different
patterns
Button Interfacingint ledPin = 13; // choose the pin for the LEDint inPin = 2; // choose the input pin (for a pushbutton)int val = 0; // variable for reading the pin statusvoid setup() {pinMode(ledPin, OUTPUT); // declare LED as outputpinMode(inPin, INPUT); // declare pushbutton as input}void loop(){val = digitalRead(inPin); // read input valueif (val == HIGH) {
// check if the input is HIGH (button released)digitalWrite(ledPin, LOW); // turn LED OFF} else {digitalWrite(ledPin, HIGH); // turn LED ON}}
DEBOUNCE--What is debounce ?--Bistable Switch
REVIEW:ARDUINO INTRODUCTION
ARDUINO PROGRAMMING
LED BLINKINGBUTTON INTERFACING
THANK
YOU!
SE
E Y
OU
TO
MO
RR
OW
……
……
……
……
……
….
top related