Introduction to Arduino Diagrams & Code Brown County Library

Similar documents
Introduction to Arduino Diagrams & Code Brown County Library

Arduino: Piezo Diagrams & Code Brown County Library. Projects 01 & 02: Scale and Playing a Tune Components needed: Arduino Uno board piezo

More Arduino Programming

Arduino Part 2. Introductory Medical Device Prototyping

Coding : programming microcontrollers

Prototyping & Engineering Electronics Kits Basic Kit Guide

Arduino: RGB LEDs Diagrams & Code Brown County Library

Arduino notes 3: Digital input via buttons

SPDM Level 2 Smart Electronics Unit, Level 2

Digital I/O Operations

Quick Start by JP Liew

Arduino: LCD Diagrams & Code Brown County Library

Connecting Arduino to Processing

Procedure: Determine the polarity of the LED. Use the following image to help:

Objectives: Learn how to input and output analogue values Be able to see what the Arduino is thinking by sending numbers to the screen

Monitor your home remotely using the Arduino

Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas

<Table of content> <Parts and description> <Circuit board Guide> <Pins> <Basics of Coding> <Intro to Arduino> <Intro> <Downloading Arduino IDO>

University of Hull Department of Computer Science C4DI Interfacing with Arduinos

Arduino 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S

Arduino Uno Microcontroller Overview

ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL

IME-100 ECE. Lab 4. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

Physical Programming with Arduino

Which LED(s) turn on? May 4, 2018 E40M Spring 2018 T. Diamandis, J. Plummer, R. Howe, C. Z. Lee 1

LDR_Light_Switch1 -- Overview

Touch Board User Guide. Introduction

Smart Objects. SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi

BASIC ARDUINO WORKSHOP. Mr. Aldwin and Mr. Bernardo

What s inside the kit

CPCS (Fall 2015), Merced College A Smart Parking Lot Dulce Meza-Flores Ashley Arredondo

Which LED(s) turn on?

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino

Arduino: Serial Monitor Diagrams & Code Brown County Library

Specification. 1.Power Supply direct from Microcontroller Board. 2.The circuit can be used with Microcontroller Board such as Arduino UNO R3.

Tutorial 1: Software Setup

TABLE OF CONTENTS INTRODUCTION LESSONS PROJECTS

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process

Lesson 8: Digital Input, If Else

Robotics/Electronics Review for the Final Exam

Arduino Programming. Arduino UNO & Innoesys Educational Shield

Arduino Course. Technology Will Save Us - Tim Brooke 10th August Friday, 9 August 13

LDR_Light_Switch2 -- Overview

Make a Simple Weather Station Using Arduino

Serial.begin ( ); Serial.println( ); analogread ( ); map ( );

LDR_Light_Switch5 -- Overview

PROGRAMMING ARDUINO COURSE ON ADVANCED INTERACTION TECHNIQUES. Luís Carriço FCUL 2012/13

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

Intro to Arduino. Zero to Prototyping in a Flash! Material designed by Linz Craig and Brian Huang

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno.

3.The circuit board is composed of 4 sets which are 16x2 LCD Shield, 3 pieces of Switch, 2

AT42QT1010 Capacitive Touch Breakout Hookup Guide

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Arduino - DigitalReadSerial

Blinking an LED 1 PARTS: Circuit 2 LED. Wire. 330Ω Resistor

Arduino Workshop. Overview. What is an Arduino? Why Arduino? Setting up your Arduino Environment. Get an Arduino based board and usb cable

Robotics and Electronics Unit 5

Using a Temperature Sensor

EMBEDDED KIT FOR EMBEDDED SOFTWARE SIMULATION AND TROUBLESHOOTING

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail

Lab 2.2 Ohm s Law and Introduction to Arduinos

Introduction to Arduino

Arrays and Loops. Programming for Engineers Winter Andreas Zeller, Saarland University

Electronic Brick Starter Kit

VKey Voltage Keypad Hookup Guide

SENSORS AND MOTORS LAB

Thumb Joystick Retail. Tools and parts you'll need. Things you'll want to know. How does it work? Skill Level: Beginner. by MikeGrusin March 22, 2011

Digital Pins and Constants

cs281: Introduction to Computer Systems Lab03 K-Map Simplification for an LED-based Circuit Decimal Input LED Result LED3 LED2 LED1 LED3 LED2 1, 2

Introduction To Arduino

Arduino Part 3. Introductory Medical Device Prototyping

ENGR 40M Project 3c: Switch debouncing

RS422/RS485 Shield. Application Note: Multiple RS485 busses. 1 Introduction

Make your own secret locking mechanism to keep unwanted guests out of your space!


Beyond the Blink: Add Drupal to Your IoT Playground. Amber Matz

Arduino 07 ARDUINO WORKSHOP 2007

ArdOS The Arduino Operating System Quick Start Guide and Examples

IME-100 ECE. Lab 3. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved

VIII.! READING ANALOG!!!!! VALUES

WEEK PRactice. Turning on LED with a Switch. Learning Objective. Materials to Prepare. Summary of Class. Project Goal. Hardware Expression

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved

micro:bit Lesson 2. Controlling LEDs on Breadboard

Arduino in a Nutshell. Jan Borchers. Version 1.6 (Jan 24, 2013) for Arduino Uno R3 & Arduino IDE Latest version at: hci.rwth-aachen.

I2C interface Tutorial

FUNCTIONS For controlling the Arduino board and performing computations.

Halloween Pumpkinusing. Wednesday, October 17, 12

ECE791/792 Project Proposal

Lab 02 Arduino 數位感測訊號處理, SPI I2C 介面實驗. More Arduino Digital Signal Process

// The REAL DEAL - Running Code. int led22 = 22; int led23 = 23; int led24 = 24; int led25 = 25; int led27 = 27; int led29 = 29; int led31 = 31;

IME-100 Interdisciplinary Design and Manufacturing

Physical Computing Self-Quiz

How to use the Zduino LEE Module with the Trainer Board

Arduino Prof. Dr. Magdy M. Abdelhameed

CARTOOINO Projects Book

3. The circuit is composed of 1 set of Relay circuit.

EXPERIMENT2. V3 Robot Navigates Autonomously with Feelers and Infrared Sensors

AVR Board Setup General Purpose Digital Output

Basic Input/Output Operations

Transcription:

Introduction to Arduino Diagrams & Code Project 01: Blinking LED Components needed: Arduino Uno board LED Put long lead into pin 13 // Project 01: Blinking LED int LED = 13; // LED connected to digital PIN 13 pinmode(led, OUTPUT); // sets the digital PIN as output digitalwrite(led, HIGH); // turns the LED on delay(1000); // waits for a second (1000 milliseconds) digitalwrite(led, LOW); // turns the LED off delay(1000); // waits for a second (1000 milliseconds)

Projects 02, 03 and 03B Components needed: Arduino Uno board LED 3 jumper wires 10k ohm resistor breadboard push button

// Project 02 : Turn on LED while the button is pressed int BUTTON = 7; // the input pin where the pushbutton is connected int val = 0; // val will be used to store the state of the input pin pinmode(led, OUTPUT); // tell Arduino LED is an output pinmode(button, INPUT); // and BUTTON is an input val = digitalread(button); // read input value and store it // Check whether the input is HIGH (button pressed) if (val == HIGH) { digitalwrite(led, HIGH); // turn LED on else { digitalwrite(led, LOW); // turn LED off

// Project 03 : Turn on LED while the button is pressed and keep it on after it is released int BUTTON = 7; // the input pin where the pushbutton is connected int val = 0; // val will be used to store the state of the input pin int state = 0; // 0 = LED off while 1 = LED on pinmode(led, OUTPUT); // tell Arduino LED is an output pinmode(button, INPUT); // and BUTTON is an input val = digitalread(button); // read input value and store it // Check whether the input is HIGH (button pressed) // and change the state if (val == HIGH) { state = 1 - state; if (state == 1) { digitalwrite(led, HIGH); // turn LED on else { digitalwrite(led, LOW); // turn LED off

// Project 03B : Turn on LED while the button is pressed and keep it on after it is released int BUTTON = 7; // the input pin where the pushbutton is connected int val = 0; // val will be used to store the state of the input pin int old_val = 0; // this variable stores the previous value of "val" int state = 0; // 0 = LED off while 1 = LED on pinmode(led, OUTPUT); // tell Arduino LED is an output pinmode(button, INPUT); // and BUTTON is an input val = digitalread(button); // read input value and store it // Check if there was a transition if ((val == HIGH) && (old_val == LOW)) { state = 1 - state; old_val = val; // val is now old, let's store it if (state == 1) { digitalwrite(led, HIGH); // turn LED on else { digitalwrite(led, LOW); // turn LED off // Project 03B with debouncing! Insert just the red text into the code above, as shown here:. // Check if there was a transition if ((val == HIGH) && (old_val == LOW)) { state = 1 - state; delay(10);

Project 04 : Turn on LED while light is hitting a light dependent resistor Components needed: Arduino Uno board LED 3 jumper wires 10k ohm resistor breadboard light dependent resistor (sometimes called a photoresistor) // Project 04 : Turn on LED while light is hitting a light dependent resistor int RESISTOR = 7; // the input pin where the light dependent resistor is connected int val = 0; // val will be used to store the state of the input pin pinmode(led, OUTPUT); // tell Arduino LED is an output pinmode(resistor, INPUT); // and RESISTOR is an input val = digitalread(resistor); // read input value and store it // Check whether the input is HIGH (light is hitting resistor) if (val == HIGH) { digitalwrite(led, HIGH); // turn LED on else { digitalwrite(led, LOW); // turn LED off

Project Project 4B: Blink LED at a rate specified by the value of the analog input Components needed: Arduino Uno board LED 3 jumper wires 10k ohm resistor breadboard light dependent resistor (sometimes called a photoresistor)

// Project 4B: Blink LED at a rate specified by the value of the analog input int val = 0; // variable used to store the value coming from the sensor pinmode(led, OUTPUT); // LED is as an OUTPUT // Note: analog pins are automatically set as inputs val = analogread(0); // read the value from the sensor digitalwrite(led, HIGH); // turn the LED on delay(val); // stop the program for some time digitalwrite(led, LOW); // turn the LED off delay(val); // stop the program for some time Learn More! Getting Started with Arduino (3 rd ed) Massimo Banzi & Michael Shiloh Sparkfun What is an Arduino?: Sparkfun s introductory tutorial learn.sparkfun.com/tutorials/what-is-an-arduino