DPNM Lab., POSTECH 1/25 CS490K - Internet of Things (IoT) Jonghwan Hyun DPNM Lab. Department of Computer Science and Engineering, POSTECH

Slides:



Advertisements
Similar presentations
Hardware and Python Steve Granda. Why would I want to do this? You want to make something interactive. You want to recreate sputnik. You want to measure.
Advertisements

EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
Lab7: Introduction to Arduino
Mini-SumoBot Construction and Programming
Embedded Sumo 1T4 – 1T5 UTRA.
Intro to the Arduino Topics: The Arduino Digital IO Analog IO Serial Communication.
10 February Event Monitoring and Event File Maintenance.
Getting your Arduino to Work: Microsoft Windows 1.Install Arduino programming environment 2.Install Arduino Uno driver 3.Make sure you can download a program.
New Human Computer Interfaces Amnon Dekel HUJI – CSE, Spring 2007 Class 3 March
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.
Intel Do-It-Yourself Challenge Hello World with the Arduino IDE Nicolas Vailliet Intel.
Intel Do-It-Yourself Challenge Lab 1: Intel Galileo’s Arduino side Nicolas Vailliet
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Arduino Part 1 Topics: Microcontrollers Programming Basics: structure and variables Digital Output Analog to Digital Conversion.
Arduino Part 2 Topics: Serial Communication Programming Constructs: functions, loops and conditionals Digital Input.
Colorado Space Grant Consortium Gateway To Space ASEN 1400 / ASTR 2500 Class #12 Gateway To Space ASEN 1400 / ASTR 2500 Class #12 T-58.
Week 10 Today 1.Homework presentations and critique. 2.Review digital and analog inputs. 3.DIY - jumpers, soldering etc.
DPNM Lab., POSTECH 1/29 CS490K - Internet of Things (IoT) Jonghwan Hyun DPNM Lab. Department of Computer Science and Engineering, POSTECH
Intro to the Arduino Topics: The Arduino Digital IO
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Introduction to the Arduino
Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB
Serial Communication. mouseX from computer to arduino processing sends a single byte of data arduino reads each byte arduino uses value to set light brightness.
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.
Basic Circuits – Lab 4 Serial and OSC (maybe some theory too) Xmedia Spring 2011.
DPNM Lab., POSTECH 1/44 CS490K - Internet of Things (IoT) Jonghwan Hyun DPNM Lab. Department of Computer Science and Engineering, POSTECH
Reading and Writing Text over USB A Colony Project Tutorial.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
Serial Communication RS-232. In order to make two devices communicate, whether they are desktop computers, microcontrollers, or any other form of integrated.
Microcontroller basics Embedded systems for mortals.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
Autumn, 2012C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Arduino Development Environment Chin-Shiuh Shieh ( 謝欽旭 ) Department.
Introduction to Arduino A very basic intro to Arduino, the IDE and the Servos class.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Introduction to Programming the Arduino Dr Gaw 3/21/14.
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
Electronic instrumentation Digitization of Analog Signal in TD
Arduino Programming. THE ARDUINO IS A MICROCONTROLLER – A LOW COST, LOW PERFORMANCE COMPUTER.
Harpeth Hall Jan 2016 Introduction to Arduino Prepared for Harpeth Hall Winterim January 2016.
WHAT ARE THE STEPS TO CONNECT MY HP DESKJET 3520 TO WI-FI?
Arduino Part 1 Topics: Microcontrollers
Lab 7 Basic 1: Game of Memory
European Robotic LABoratory
Assist. Prof. Rassim Suliyev - SDU 2017
Val Manes Department of Math & Computer Science
Downloading Arduino FOR WINDOWS.
Manual for Arduino Kit v1.0
Wireless Cue Light Project
Intro to the Arduino Created by
Arduino & its hardware interfacing
UTA010 : Engineering Design – II
Welcome to Arduino A Microcontroller.
Arduino Part 1 Topics: Microcontrollers Programming Basics
INC 161 , CPE 100 Computer Programming
Roller Coaster Design Project
مقدمة في الاردنيو د فضل الاكوع.
Intro to the Arduino Topics: The Arduino Digital IO
Building an Internet of Things Device
Debugging Debug environments Debug via serial
Intro to the Arduino by Someet Singh
Programming 2: The Arduino IDE & First Sketches
Appliace Remote Control
Aeroponic Engineering and Vertical Farming
Arduino Leonardo Setup
Downloading Arduino FOR MAC.
Lab #1: Getting Started.
Model Blimp Design Competition Programming Workshop by Youth College (International) / VTC May
Introduction to Arduino IDE and Software
Department of Engineering Science EE 465 (CES 440) - Intro
Presentation transcript:

DPNM Lab., POSTECH 1/25 CS490K - Internet of Things (IoT) Jonghwan Hyun DPNM Lab. Department of Computer Science and Engineering, POSTECH Oct. 16, 2014 Introduction to Arduino #2

DPNM Lab., POSTECH 2/25 CS490K - Internet of Things (IoT) Installing Arduino  What do we need?  (Optional)

DPNM Lab., POSTECH 3/25 CS490K - Internet of Things (IoT) Installing Arduino 1.Download & install the Arduino environment (IDE) 2.Connect the board to your computer via the USB cable 3.Install the drivers 4.Launch the Arduino IDE 5.Select your board 6.Select your serial port 7.Write codes 8.Upload the program Reference:

DPNM Lab., POSTECH 4/25 CS490K - Internet of Things (IoT) Installing Arduino  Download & install the Arduino environment (IDE) Official homepage: Link for faster download No installer needed, except for Windows Java needs to be installed (Windows) Install drivers during IDE installation (Linux) $ sudo apt-get install arduino  Prerequisite for Linux Assumes running Ubuntu $ sudo apt-get remove brltty

DPNM Lab., POSTECH 5/25 CS490K - Internet of Things (IoT) Installing Arduino  Connect the board to your computer via the USB cable USB A type USB B type USB A type USB B type

DPNM Lab., POSTECH 6/25 CS490K - Internet of Things (IoT) Installing Arduino  Connecting Arduino MAC Click “Network Preferences”, and in the window that appears, click “Apply”. Linux $ ls /dev/tty* SHOULD have device name like ttyACM*, ttyUSB* or ttyS* Windows

DPNM Lab., POSTECH 7/25 CS490K - Internet of Things (IoT) Programming Arduino  Launch the Arduino IDE

DPNM Lab., POSTECH 8/25 CS490K - Internet of Things (IoT) Programming Arduino  Select board

DPNM Lab., POSTECH 9/25 CS490K - Internet of Things (IoT) Programming Arduino  Select your serial port (Windows) Device manager (Win + R  “devmgmt.msc” ) (MAC) tty.usbmodem (Linux) /dev/tty/USB* or /dev/tty.USB*

DPNM Lab., POSTECH 10/25 CS490K - Internet of Things (IoT) Programming Arduino  Programming Reference

DPNM Lab., POSTECH 11/25 CS490K - Internet of Things (IoT) Sample Program – LED Blink  LED Blink Blinking LED on Arduino board  Codes Load the “Blink” example File  Examples  Basics  Blink

DPNM Lab., POSTECH 12/25 CS490K - Internet of Things (IoT) Sample Program – LED Blink  Verify & Compile Once it compiles, you must see the following messages in the Status bar and the Program notification Area

DPNM Lab., POSTECH 13/25 CS490K - Internet of Things (IoT) Sample Program – LED Blink  Upload to the board Once it upload, you must see the following messages in the Status bar and the Program notification Area

DPNM Lab., POSTECH 14/25 CS490K - Internet of Things (IoT) Sample Program – Serial Communication  Serial communication Arduino uses serial ports to communicate with PC  Writing Serial.begin (baud) Initialize serial port for communication Sets baud rate Example –Serial.begin(9600); // 9600 baud Serial.print (val), Serial.print (val, fmt) Prints data to the serial port Examples –Serial.print(“Hi”); // print a string –Serial.print(78); // works with numbers, too –Serial.print(variable); // works with variables –Serial.print(78,BIN); // will print Serial.println(val) Same as Serial.print(), but with line-feed

DPNM Lab., POSTECH 15/25 CS490K - Internet of Things (IoT) Sample Program – Serial Communication  Reading Serial.available() Returns the number of bytes available to be read, if any Example –if (Serial.available() > 0) data = Serial.read(); Reading data from serial port letter = Serial.read() letters = Serial.readBytesUntil(character, buffer, length) number = Serial.parseInt() number = Serial.parseFloat()  Serial Monitor Send / Receive serial data Included in the IDE Ctrl – Shift – M

DPNM Lab., POSTECH 16/25 CS490K - Internet of Things (IoT) Sample Program – Serial Communication  Echo Arduino will echo anything you send to it until you send, (a comma) Source codes /* Use a variable called byteRead to temporarily store the data coming from the PC */ byte byteRead; void setup() { // Turn the Serial Protocol ON Serial.begin(9600); } void loop() { /* check if data has been sent from the computer: */ if (Serial.available()) { /* read the most recent byte */ byteRead = Serial.read(); /*Listen for a comma which equals byte code # 44 */ if(byteRead==44){ Serial.println(); }else{ /*ECHO the value that was read, back to the serial port. */ Serial.write(byteRead); }

DPNM Lab., POSTECH 17/25 CS490K - Internet of Things (IoT) Announcement  Assignment #6 - Programming on Arduino Implement a simple calculator on Arduino board Serial communication interface can be used to communicate with the board Try to figure out the maximum value of integer that the Arduino can handle Hand in your source code and running screenshots