Lecture 2-2: Arduino Programming

Slides:



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

EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
ARDUINO CLUB What we’re really doing. BASICS The setup() and loop() functions.
Lab7: Introduction to Arduino
How to use Arduino By: Andrew Hoffmaster.
Embedded Sumo 1T4 – 1T5 UTRA.
Introduction to Arduino Programming January MER-421:Mechatronic System Design.
1 Arduino Board: Arduino UNO Arduino Programing Environment: Arduino 0022
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.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
Cascade switching of an LED EAS 199B Winter 2013.
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Code The Arduino Environment.
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
Arduino libraries Datatekniker Udvidet hardware/software.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
ME 120: Arduino Programming Arduino Programming Part II ME 120 Mechanical and Materials Engineering Portland State 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?
Autumn, 2012C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Arduino Development Environment Chin-Shiuh Shieh ( 謝欽旭 ) Department.
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
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.
Harpeth Hall Jan 2016 Introduction to Arduino Prepared for Harpeth Hall Winterim January 2016.
Arduino - Introduction
Arduino.
Embedded Systems Intro to the Arduino
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Microcontroller basics
Dr. Kyung Eun Park Summer 2017
More on LED’s with Arduino
Val Manes Department of Math & Computer Science
Microcontroller basics
Arduino & its hardware interfacing
Arduino Programming Part II
UTA010 : Engineering Design – II
Cascade switching of an LED
European Robotic LABoratory
UCD ElecSoc Robotics Club 2017/2018
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
Arduino Part 1 Topics: Microcontrollers Programming Basics
INC 161 , CPE 100 Computer Programming
Introduction to Arduino Microcontrollers
Introduction to Arduino Microcontrollers
Introduction to Arduinos
Roller Coaster Design Project
ARDUINO     What is an Arduino? Features 14 Digital I/O pins 6 Analogue inputs 6 PWM pins USB serial 16MHz Clock speed 32KB Flash memory 2KB SRAM.
using for loops to control LEDs
using the Arduino to make LEDs flash
1 Code
Using Photoresistors with an Arduino
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Arduino: For Loops.
Arduino programs Arduino toolchain Cross-compilation Arduino sketches
Topics: Programming Constructs: loops & conditionals Digital Input
Programming 2: The Arduino IDE & First Sketches
CTY SAR FCPS Shawn Lupoli, Elliot Tan
I/O Programming with Arduino
Aeroponic Engineering and Vertical Farming
Arduino Uno circuit basics
Setting up a basic program with Arduino
Introduction to Arduinos
SAURABH GINGADE.
Model Blimp Design Competition Programming Workshop by Youth College (International) / VTC May
Arduino程式範例.
Introduction to Arduino IDE and Software
Presented By,  Mamata Yadav (BE Elex & Comm.) Vice R&D Coordinator(HW), PCRT  Payal Shah (BE Elex & Comm.)  Ananta Das (BE Elex & Comm.) R&D Team,PCRT.
Presentation transcript:

Lecture 2-2: Arduino Programming Dr. Kyung Eun Park Summer 2017 Arduino Language Reference: https://www.arduino.cc/en/Reference/HomePage

Arduino Programming Environment

Board Type Setting https://www.arduino.cc/en/Main/Software

Serial Port / COM Port

Arduino IDE Components

Parts of the Sketch

Operators Assignment Operator Equal Sign = : used to assign a value == : used to compare values if (a == 5)

Boolean Operators AND OR NOT && if ((a == 5) && (b == 10)) || ! if (!isCompleted)

Variable Declaration Syntax: Example: type variable_identifier; type variable_identifier = value; Example: int num; int sum = 0; int i = j = 0; int count = 0; double avg = sum/count ; char ch; char chSep = ','; boolean flag = false;

Arduino Function: setup() This setup() function comes before the loop function Need for all Arduino sketches Syntax: void setup() { … }

Arduino Function: pinMode(13,OUTPUT) Digital pins can be used as INPUT, INPUT_PULLUP, or OUTPUT Outputs are declared in setup(). Pin 13 is specified to behave as an output Syntax: pinMode(13, OUTPUT); Declares digital pin #13 as an output

Arduino Function: Serial.begin(9600) Serial communication begins in setup() Syntax: Serial.begin(9600); Declares Serial communication at a baud (bit per second) rate of 9600.

Digital I/O Function: digitalWrite(12,HIGH) Write a HIGH or a LOW value to a digital pin 5V (or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW Syntax: digitalWrite(12, HIGH); Sets pin #12 to HIGH

LED Program Sets pin 13 to HIGH, makes a one-second-long delay, and sets the pin back to LOW

Use Examples_Basics_Blink

Blink Example: verify and upload

Arduino MEGA Board with Blink Example https://www.facebook.com/noonmooltree/videos/1544160562295757/

Digital I/O Function: digitalRead(inPin) Reads the value from a specified digital pin, either HIGH or LOW Sets pin #13 to the same value as pin #7, declared as an input