:Blink Blink: Er. Sahil Khanna www.SahilKhanna.org.

Slides:



Advertisements
Similar presentations
Khaled A. Al-Utaibi Interfacing an LED The Light Emitting Diode (LED) Applications DC Characteristics & Operation Interfacing to.
Advertisements

ARDUINO CLUB What we’re really doing. BASICS The setup() and loop() functions.
Electrical team Arduino tutorial I BY: JOSHUA arduini
Lab7: Introduction to Arduino
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Embedded Sumo 1T4 – 1T5 UTRA.
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
ELCT 201 week 13 Analog ON/OFF control system conversion to Digital ON/OFF control system.
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2011 LWTL faculty team.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Embedded Programming and Robotics
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
chipKit Sense Switch & Control LED
1 Applied Control Systems Technology. 2 Pin configuration Applied Control Systems.
Programming Hexors on Arduino Uno. Arduino Uno Arduino is an open-source electronics platform based on easy- to-use hardware and software. It's intended.
Introduction to the Arduino
Khaled A. Al-Utaibi  The Push Button  Interfacing Push Buttons to Arduino  Programming Digital Inputs  Working with “Bouncy”
Cascade switching of an LED EAS 199B Winter 2013.
Good LED Circuit 5V0 GND. What Voltage Does Meter See? Answer: 5 V.
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
Who Are You, Arduino? Er. Sahil Khanna
Microcontrollers, Microcomputers, and Microprocessors
Arduino libraries Datatekniker Udvidet hardware/software.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
Embedded Programming and Robotics Lesson 11 Arduino Interrupts 1.
Microcontroller basics Embedded systems for mortals.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Istituto Tecnico Industriale A.Monaco EURLAB Control a Servo Motor If you want to swing an robot arm or … steer a robot you need a special motor (Servo).
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
ME 120: Arduino Programming Arduino Programming Part 1 ME 120 Mechanical and Materials Engineering Portland State University
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Having fun with code, using Arduino in a middle school CS classroom
Assist. Prof. Rassim Suliyev - SDU 2017
Microcontroller basics
If you want to swing an robot arm or …
Val Manes Department of Math & Computer Science
Microcontroller basics
UTA010 : Engineering Design – II
Cascade switching of an LED
Welcome to Arduino A Microcontroller.
Get Your Project Started with Arduino
European Robotic LABoratory
UCD ElecSoc Robotics Club 2017/2018
Arduino Part 1 Topics: Microcontrollers Programming Basics
3.0 ARDUINO WORKSHOP PRESENTATION FOR STUDENTS IN 4º DEGREE OF COMPULSORY SECONDARY EDUCATION 3.0.
Arduino.
Въведение в Arduino.
Week 6: Microcontrollers II
Arduino 101 Credit(s):
Using Photoresistors with an Arduino
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Logic Gates Practical Objective: to develop an understanding of logic circuits and truth tables.
Welcome to Digital Electronics using the Arduino Board
Arduino programs Arduino toolchain Cross-compilation Arduino sketches
Programming 2: The Arduino IDE & First Sketches
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Arduino Motor Lab Inspired by NYU ITP project
Aeroponic Engineering and Vertical Farming
Arduino Uno circuit basics
Setting up a basic program with Arduino
SAURABH GINGADE.
Arduino程式範例.
Interrupts.
Presentation transcript:

:Blink Blink: Er. Sahil Khanna

It’s VIDEO time!

Circuit Diagram

//Code Download Link ->

int led = 8; Code Explantation Pin number of Arduino attached to led. Assigning a variable for pin 8 Nature of variable i.e. integer // Button is connected to Pin 2 int button = 2; // Declare some variables. We'll see what we gonna do to them, later. int val=0; int check=0;

Code Explantation // the setup routine runs once when you press reset: void setup() { // initialize the digital button pin as an input. pinMode(button, INPUT); // initialize the digital led pin as an output. pinMode(led, OUTPUT); } Setting what the pin(in this case the button) will act as i.e. OUTPUT or INPUT. As we will be reading the signal from the button, so we will assign it as an INPUT. As we will be turning on the LED, so we will assign it as an OUTPUT.

Code Explantation // the loop routine runs over and over again forever: void loop(){ val=digitalRead(button); //reading values from button and saving it in the val variable. if(val==1){ check=~check; //if button is pressed then compliment the value of check. delay(500); //wait for 0.5 seconds } if(check==1) blink(); // blink only if the value of check is one. } This function helps us to read digital values from our “button” pin and then save it in “val” integer. Here we have used a custom made function to define the blinking process. Lets see how it works.

Code Explantation void blink() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(200); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(200); // wait for a second } This function tells to make the given pin(in this case our LED) as either HIGH(1 or 5V) or LOW(0 or 0V). This function gives us a delay in milli seconds i.e. if we have given 1000 then the delay is 1 sec and if 200 then 0.2 seconds and so on.

Arduino is constantly checking the signal from the button(which is fed into val). What’s Happening? Whenever the button(val = 1) is pressed it compliments the value of check variable. When the value of check becomes 1, our arduino starts the blinking process.

Congratulations, You have just made your first Arduino code. for any doubts mail me at Aloha… Give yourself a pat on the back. You did great! or find me here ->