boolean running = false; // false off, true on boolean gezielt = false; // Water turned on on purpose, true=on, false=off

Size: px
Start display at page:

Download "boolean running = false; // false off, true on boolean gezielt = false; // Water turned on on purpose, true=on, false=off"

Transcription

1 // wetcat.ino // program to steer garden watering system #include <IRremote.h> #include <IRremoteInt.h> // LED unsigned int LED_PIN_13 = 13; // IR receiver unsigned int RECV_PIN = 11; // IR codes remotes unsigned long IRCode_FB_TV_Power1 = ; unsigned long IRCode_FB_TV_TV1 = ; unsigned long IRCode_FB_TV_Info1 = ; // IR Sensor IRrecv irrecv(recv_pin); decode_results results; // MOSFET unsigned int MF_PIN = 9; // Bewegungsmelder unsigned int MOVEMENT = 7; unsigned int MOVEMENT_STATE = 0; static unsigned long ts_move; // To store the "current" time of the detected movement for delays. boolean running = false; // false off, true on boolean gezielt = false; // Water turned on on purpose, true=on, false=off unsigned int DELAY_200ms = 200; unsigned int DELAY_500ms = 500; unsigned int DELAY_1S = 1000; unsigned int DELAY_2S = 2000; unsigned int DELAY_3S = 3000; unsigned int DELAY_5S = 5000; unsigned int DELAY_10S = 10000; // Status LED boolean system_state_led = false; // HIGH or LOW static unsigned long ts_system_state; // to store the time the system state LED was last on // Zustände #define S_IDLE 1 #define S_DETECT_MOVEMENTS 2 #define S_WAITON_MOVEMENTS 3 #define S_WATER_OFF 4 #define S_WATER_ON_PURPOSE 5 #define S_WATER_OFF_PURPOSE 6

2 #define S_TURNOFF 9 static int // initial state is 1, the "idle" state. //#define DEBUG 1 void setup() { pinmode(led_pin_13, OUTPUT); pinmode(mf_pin, OUTPUT); // initialize magnet valve pin irrecv.enableirin(); // initialize IR receiver pin pinmode(movement, INPUT); // initialize PIR sensor pin Serial.begin(9600); // serial connection // initialize, Status LED blinks // setup() void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, DEC); irrecv.resume(); // Receive the next value turnonoroff(results); // System on / off //turnwateronoroff(results); // Water on / off wateronpurpose(results); // if (irrecv.decode(&results)) switch(state) { case S_IDLE: 1 Serial.println("IDLE"); case S_DETECT_MOVEMENTS: // Detect movements if system on if ( running &&!gezielt ) { Serial.println("state detect movements, on /!gezielt"); // TODO Status LED wenn PIR Sensor aktiv //ts_system_state = millis(); //statusled();

3 // read whether movement detected MOVEMENT_STATE = digitalread(movement); // if movement detected if( MOVEMENT_STATE == HIGH ) { ts_move = millis(); turnwateron(true); Serial.println("movement detected"); state = S_WAITON_MOVEMENTS; else { //Serial.println("No movement detected"); else { case S_WAITON_MOVEMENTS: Serial.println("state wait / react on movement"); if ( running ) { // If a half second has passed, then move on to the next state. if(millis() > ts_move + DELAY_5S) { state = S_WATER_OFF; // TEST case S_WATER_ON_PURPOSE: Serial.println("state water on purpose"); turnwateron(true); Serial.println("Water on on purpose"); case S_WATER_OFF_PURPOSE: Serial.println("state water off on purpose"); Serial.println("state water off on purpose"); // FIXME reuse this state case S_WATER_OFF:

4 Serial.println("state water off"); // must work independet of any state / mode! ts_move = millis(); // Remember the current time state = S_DETECT_MOVEMENTS; // go back detecting case S_TURNOFF: Serial.println("state turn system off"); // Return to the "idle" state. default: // switch(state) // loop() void turnonoroff(decode_results results) { Serial.println("system on / off"); // System einschalten if( (results.value == IRCode_FB_TV_Power1) && (!running) ) { running =!running; state = S_DETECT_MOVEMENTS; // System ausschalten else if( ( (results.value == IRCode_FB_TV_Power1) && (running) ) { running =!running; state = S_TURNOFF; Serial.println(running?"system on":"system off"); // turnonoroff() // Wasser gezielt einschalten void wateronpurpose(decode_results results) { // wait for turning system on on purpose if( (results.value == IRCode_FB_TV_Info1) && (!gezielt) ) { gezielt =!gezielt;

5 turnwateron(true); state = S_WATER_ON_PURPOSE; else if( (results.value == IRCode_FB_TV_Info1) && (gezielt) ) { // turn system off gezielt =!gezielt; state = S_WATER_OFF_PURPOSE; // wateronpurpose() void blink() { // blink() void statusled() { if(millis() > ts_system_state + DELAY_2S) { system_state_led =!system_state_led; //ts_system_state = millis(); else { // statusled() void turnwateron( boolean yesorno ) { if( yesorno ) { digitalwrite(mf_pin, HIGH); // turn on the water // turn on the light else { // turn off the light digitalwrite(mf_pin, LOW); // turn off the water // turnwateron()

Lojamundi Tecnologia Sem Limites br

Lojamundi Tecnologia Sem Limites   br IR Remote Aprenda a fazer um controle remoto com arduino Sobre esse artigo Autor: aaron aaron@cubietech.com 2014/02/27 20:49 Copyrights: CC Attribution-Share Alike 3.0 Unported Contribuidores: Cubieboard

More information

EXPERIMENT 7 Please visit https://www.arduino.cc/en/reference/homepage to learn all features of arduino before you start the experiments

EXPERIMENT 7 Please visit https://www.arduino.cc/en/reference/homepage to learn all features of arduino before you start the experiments EXPERIMENT 7 Please visit https://www.arduino.cc/en/reference/homepage to learn all features of arduino before you start the experiments TEMPERATURE MEASUREMENT AND CONTROL USING LM35 Purpose: To measure

More information

Workshop on Microcontroller Based Project Development

Workshop on Microcontroller Based Project Development Organized by: EEE Club Workshop on Microcontroller Based Project Development Presented By Mohammed Abdul Kader Assistant Professor, Dept. of EEE, IIUC Email:kader05cuet@gmail.com Website: kader05cuet.wordpress.com

More information

RGB LED Strip Driver Shield SKU:DFR0274

RGB LED Strip Driver Shield SKU:DFR0274 RGB LED Strip Driver Shield SKU:DFR0274 Contents 1 Introduction 2 Specification 3 Pin Out 4 Sample Code 4.1 LED Strip driving code 4.2 IR Receiving Code 4.3 IR Remote control Demo Introduction The RGB

More information

User Guide v1.0. v1.0 Oct 1, This guide is only available in English Ce manuel est seulement disponible en Anglais

User Guide v1.0. v1.0 Oct 1, This guide is only available in English Ce manuel est seulement disponible en Anglais ROVER ShiELD User Guide v1.0 v1.0 Oct 1, 2014 This guide is only available in English Ce manuel est seulement disponible en Anglais Description The DFRobotShop Rover Shield is the ideal all in one shield

More information

CONSTRUCTION GUIDE Remote Big Wheel. Robobox. Level VIII

CONSTRUCTION GUIDE Remote Big Wheel. Robobox. Level VIII CONSTRUCTION GUIDE Remote Big Wheel Robobox Level VIII Remote Big Wheel In this box we will learn about an advanced use of motors and infrared emission & reception through a unique robot: the Big Wheel.

More information

DFRduino Beginner Kit For Arduino V3 SKU:DFR0100

DFRduino Beginner Kit For Arduino V3 SKU:DFR0100 DFRduino Beginner Kit For Arduino V3 SKU:DFR0100 Contents 1 Introduction 2 Getting Started with Arduino 3 Tutorial 3.1 Blinking a LED 3.2 SOS Beacon 3.3 Traffic Light 3.4 Fading Light 3.5 RGB LED 3.6 Alarm

More information

Lesson 3 Infrared Controlling Car

Lesson 3 Infrared Controlling Car Lesson 3 Infrared Controlling Car 1 The points of section Infrared remote control is a widely used method for remote control. The car has been equipped with infrared receiver and thus allows it to be controlled

More information

DIY Remote Control Robot Kit (Support Android) SKU:COMB0004

DIY Remote Control Robot Kit (Support Android) SKU:COMB0004 DIY Remote Control Robot Kit (Support Android) SKU:COMB0004 Contents [hide] 1 Overall o 1.1 Microcontroller 2 Part List o 2.1 Basic Kit o 2.2 Upgrade Components o 2.3 Additional Parts Required 3 Assembly

More information

The Arduino C code for the project is given in Appendix A. The general functionality and logic of the code is given as follows:

The Arduino C code for the project is given in Appendix A. The general functionality and logic of the code is given as follows: Objective and Overview The objective of the second project for this course was to explore and design an architectural robotics system or component for use by children, taking into consideration their needs.

More information

Project 2: Sensor Light

Project 2: Sensor Light Project 2: Sensor Light In this session, we will create a sensor light. The behavior we want to implement is as follows: - When the sensor detects human motion, the LED light will be on - When no human

More information

Elejandro the Electronic Elephant

Elejandro the Electronic Elephant Anagnost, Newberry 1 Kaitlin Anagnost Alex Newberry 12/4/17 Physics 124 Monday Lab Elejandro the Electronic Elephant Motivation As we enter the age of technology, people rely on convenient, cheap, on the

More information

IR Breakbeam Sensors. Created by lady ada. Last updated on :32:59 PM UTC

IR Breakbeam Sensors. Created by lady ada. Last updated on :32:59 PM UTC IR Breakbeam Sensors Created by lady ada Last updated on 2017-12-08 10:32:59 PM UTC Guide Contents Guide Contents Overview Arduino CircuitPython 2 3 5 8 Adafruit Industries https://learn.adafruit.com/ir-breakbeam-sensors

More information

keyestudio keyestudio advanced study kit for Arduino

keyestudio keyestudio advanced study kit for Arduino keyestudio advanced study kit for Arduino Catalog Kit introduction... 1 Introduction of Keyestudio UNO R3 board...1 Introduction of Keyestudio Mega 2560 R3 board... 6 Components List... 9 Project list...14

More information

keyestudio ARDUINO super learning kit

keyestudio ARDUINO super learning kit ARDUINO super learning kit 1 Catalog 1. Introduction... 3 2. Component list... 3 3. Project list...10 4. Project details... 11 Project 1: Hello World...11 Project 2: LED blinking... 14 Project 3: PWM...16

More information

Arduino Prof. Dr. Magdy M. Abdelhameed

Arduino Prof. Dr. Magdy M. Abdelhameed Course Code: MDP 454, Course Name:, Second Semester 2014 Arduino What is Arduino? Microcontroller Platform Okay but what s a Microcontroller? Tiny, self-contained computers in an IC Often contain peripherals

More information

More Arduino Programming

More Arduino Programming Introductory Medical Device Prototyping Arduino Part 2, http://saliterman.umn.edu/ Department of Biomedical Engineering, University of Minnesota More Arduino Programming Digital I/O (Read/Write) Analog

More information

Arduino Part 2. Introductory Medical Device Prototyping

Arduino Part 2. Introductory Medical Device Prototyping Introductory Medical Device Prototyping Arduino Part 2, http://saliterman.umn.edu/ Department of Biomedical Engineering, University of Minnesota More Arduino Programming Digital I/O (Read/Write) Analog

More information

Arduino Programming Part 7: Flow charts and Top-down design

Arduino Programming Part 7: Flow charts and Top-down design Arduino Programming Part 7: Flow charts and Top-down design EAS 199B, Winter 2013 Gerald Recktenwald Portland State University gerry@me.pdx.edu Goals Introduce flow charts A tool for developing algorithms

More information

Robotics/Electronics Review for the Final Exam

Robotics/Electronics Review for the Final Exam Robotics/Electronics Review for the Final Exam Unit 1 Review. 1. The battery is 12V, R1 is 400 ohms, and the current through R1 is 20 ma. How many ohms is R2? ohms What is the voltage drop across R1? V

More information

ME 121 Gerald Recktenwald Portland State University

ME 121 Gerald Recktenwald Portland State University Arduino Programming Part 7: Flow charts and Top-down design ME 121 Gerald Recktenwald Portland State University gerry@me.pdx.edu Goals Introduce flow charts A tool for developing algorithms A tool for

More information

unsigned long NextTelevisonFlicker; // The time the TV light level is changed.

unsigned long NextTelevisonFlicker; // The time the TV light level is changed. // THIS IS THE TEXT SOURcE CODE OF file: Auto_House.ino /* Arduino MICRO software to operate an automated model train home. Written by: Bruce Kingsley Date: July 05, 2014 Version: 1.0.0 Revsion Note: */

More information

loop switch ( ) { case STATE_INIT: // // break; case STATE_SETTING: // // break; case STATE_COUNTDOWN: // // break; case STATE_PAUSE: // // break;

loop switch ( ) { case STATE_INIT: // // break; case STATE_SETTING: // // break; case STATE_COUNTDOWN: // // break; case STATE_PAUSE: // // break; 2 3 4 loop switch ( ) { case STATE_IIT: break; case STATE_SETTIG: break; case STATE_COUTDOW: break; case STATE_PAUSE: break; case STATE_ALARM: break; default: break; 5 6 7 case STATE_IIT : displaytimer(time,

More information

Arduino Uno Microcontroller Overview

Arduino Uno Microcontroller Overview Innovation Fellows Program Arduino Uno Microcontroller Overview, http://saliterman.umn.edu/ Department of Biomedical Engineering, University of Minnesota Arduino Uno Power & Interface Reset Button USB

More information

Arduino Uno. Power & Interface. Arduino Part 1. Introductory Medical Device Prototyping. Digital I/O Pins. Reset Button. USB Interface.

Arduino Uno. Power & Interface. Arduino Part 1. Introductory Medical Device Prototyping. Digital I/O Pins. Reset Button. USB Interface. Introductory Medical Device Prototyping Arduino Part 1, http://saliterman.umn.edu/ Department of Biomedical Engineering, University of Minnesota Arduino Uno Power & Interface Reset Button USB Interface

More information

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

Lab 02 Arduino 數位感測訊號處理, SPI I2C 介面實驗. More Arduino Digital Signal Process Lab 02 Arduino 數位感測訊號處理, SPI I2C 介面實驗 More Arduino Digital Signal Process Blink Without Delay Sometimes you need to do two things at once. For example you might want to blink an LED (or some other timesensitive

More information

Introduction To Arduino

Introduction To Arduino Introduction To Arduino What is Arduino? Hardware Boards / microcontrollers Shields Software Arduino IDE Simplified C Community Tutorials Forums Sample projects Arduino Uno Power: 5v (7-12v input) Digital

More information

- 1 - /*Code for data logging for Arduino with Atmega328 chip and 3 differential pressure

- 1 - /*Code for data logging for Arduino with Atmega328 chip and 3 differential pressure - 1 - Software code /*Code for data logging for Arduino with Atmega328 chip and 3 differential pressure sensors MPX5100DP mounted on tensiometers for monitoring water potential in soils. After powering,

More information

Create your own wireless motion sensor with

Create your own wireless motion sensor with Create your own wireless motion sensor with Arduino If you have a friend that has an alarm system in his or her home, I am sure you ve all seen these white motion sensors that are usually fixed above doors

More information

keyestudio keyestudio New Sensor kit

keyestudio keyestudio New Sensor kit New Sensor kit 37 in 1 box for Arduino starters Sensor kit for Arduino Based on open-source hardware 37 various sensors in one box For you to make interesting projects www..cc Content 1. Summary... 1 2.

More information

Send commands via bluetooth, e.g. irise app for Android

Send commands via bluetooth, e.g. irise app for Android /** Sunrise alarm clock Waking up with a sunrise simulation Mood light Send commands via bluetooth, e.g. irise app for Android */ command i20:45z s06:10z dz m1..9e r1z y1z zz tz kz lz bz v1e description

More information

Lab 8. Arduino and WiFi - IoT applications

Lab 8. Arduino and WiFi - IoT applications Lab 8. Arduino and WiFi - IoT applications IoT - Internet of Things is a recent trend that refers to connecting smart appliances and electronics such as microcontrollers and sensors to the internet. In

More information

Team Java Whiz: Software Code

Team Java Whiz: Software Code Team Java Whiz: Software Code Table of Contents ALL SUBSYSTEM CODE 2 BUMPER 5 CONVEYOR 8 IR DETECTION 9 LOOP 11 MOTOR 18 SETUP 20 TAPE SENSOR 21 TIMERS 22 1 All Subsystem Code /**************************************************************

More information

Arduino notes IDE. Serial commands. Arduino C language. Program structure. Arduino web site:

Arduino notes IDE. Serial commands. Arduino C language. Program structure. Arduino web site: 1 Arduino notes This is not a tutorial, but a collection of personal notes to remember the essentials of Arduino programming. The program fragments are snippets that represent the essential pieces of code,

More information

SleepyPillow.ino. Author: Solveigh. When turned on play random tracks for the desired time.. After this time shut down the Arduino to save power.

SleepyPillow.ino. Author: Solveigh. When turned on play random tracks for the desired time.. After this time shut down the Arduino to save power. / SleepyPillow.ino Author: Solveigh When turned on play random tracks for the desired time.. After this time shut down the Arduino to save power. With code samples from http://playground.arduino.cc/learning/arduinosleepcode

More information

IR Communication a learn.sparkfun.com tutorial

IR Communication a learn.sparkfun.com tutorial IR Communication a learn.sparkfun.com tutorial Available online at: http://sfe.io/t33 Contents Getting Started IR Communication Basics Hardware Setup Receiving IR Example Transmitting IR Example Resources

More information

#define CE_PIN 12 //wireless module CE pin #define CSN_PIN 13 //wireless module CSN pin. #define angleaveragenum 1

#define CE_PIN 12 //wireless module CE pin #define CSN_PIN 13 //wireless module CSN pin. #define angleaveragenum 1 /***************************************************************************************************** define statements *****************************************************************************************************/

More information

Connecting Arduino to Processing

Connecting Arduino to Processing Connecting Arduino to Processing Introduction to Processing So, you ve blinked some LEDs with Arduino, and maybe you ve even drawn some pretty pictures with Processing - what s next? At this point you

More information

TANGIBLE MEDIA & PHYSICAL COMPUTING MORE ARDUINO

TANGIBLE MEDIA & PHYSICAL COMPUTING MORE ARDUINO TANGIBLE MEDIA & PHYSICAL COMPUTING MORE ARDUINO AGENDA RECAP ALGORITHMIC APPROACHES TIMERS RECAP: LAST WEEK WE DID: ARDUINO IDE INTRO MAKE SURE BOARD AND USB PORT SELECTED UPLOAD PROCESS COVERED DATATYPES

More information

// 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;

// 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; /* // 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; int led33 = 33; int led35 = 35; int led36 = 36; int

More information

Introduction to Arduino. Wilson Wingston Sharon

Introduction to Arduino. Wilson Wingston Sharon Introduction to Arduino Wilson Wingston Sharon cto@workshopindia.com Physical computing Developing solutions that implement a software to interact with elements in the physical universe. 1. Sensors convert

More information

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

Serial.begin ( ); Serial.println( ); analogread ( ); map ( ); Control and Serial.begin ( ); Serial.println( ); analogread ( ); map ( ); A system output can be changed through the use of knobs, motion, or environmental conditions. Many electronic systems in our world

More information

1 Making Decisions in Arduino Programs

1 Making Decisions in Arduino Programs ME 120: If-then-else structures in Arduino October 11, 2018 Gerald Recktenwald gerry@pdx.edu 1 Making Decisions in Arduino Programs It s incredibly useful that computer programs can respond to changing

More information

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

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail Reacting to Sensors In this tutorial we will be going over how to program the Arduino to react to sensors. By the end of this workshop you will have an understanding of how to use sensors with the Arduino

More information

Quickstart Guide: Programming the Arduino ESP 8266

Quickstart Guide: Programming the Arduino ESP 8266 Quickstart Guide: Programming the Arduino ESP 8266 V1.0 - March 2018 Part 1: Setting up the Arduino 1. Connect to your wireless network 2. Install Arduino software from www.arduino.cc 3. Check if Windows

More information

Introduction to Microcontrollers Using Arduino. PhilRobotics

Introduction to Microcontrollers Using Arduino. PhilRobotics Introduction to Microcontrollers Using Arduino PhilRobotics Objectives Know what is a microcontroller Learn the capabilities of a microcontroller Understand how microcontroller execute instructions Objectives

More information

IME-100 Interdisciplinary Design and Manufacturing

IME-100 Interdisciplinary Design and Manufacturing IME-100 Interdisciplinary Design and Manufacturing Introduction Arduino and Programming Topics: 1. Introduction to Microprocessors/Microcontrollers 2. Introduction to Arduino 3. Arduino Programming Basics

More information

TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO

TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO AGENDA ARDUINO HARDWARE THE IDE & SETUP BASIC PROGRAMMING CONCEPTS DEBUGGING & HELLO WORLD INPUTS AND OUTPUTS DEMOS ARDUINO HISTORY IN 2003 HERNANDO

More information

Goal: Strengthen our understanding of C and program our Mudduino boards

Goal: Strengthen our understanding of C and program our Mudduino boards Goal: Strengthen our understanding of C and program our Mudduino boards #include #define myarraysize 10 int myarray[myarraysize] = 34, 18, -12, 7, 5; int i; printf("values are: ["); for(i=0;

More information

Imperativ Programming. morning (again) Jens Dalsgaard Nielsen Aalborg University (1/24)

Imperativ Programming. morning (again) Jens Dalsgaard Nielsen Aalborg University (1/24) Imperativ Programming morning (again) Jens Dalsgaard Nielsen (jdn@es.aau.dk) Aalborg University (1/24) message Changed timing today Jens Dalsgaard Nielsen (jdn@es.aau.dk) Aalborg University (2/24) Jens

More information

myservoa.attach(3); // attaches the servo on pin 3 to the servo object //copy from servo code

myservoa.attach(3); // attaches the servo on pin 3 to the servo object //copy from servo code #include #include //copy from servo code // a maximum of eight servo objects can be created Servo myservoa; // works on motor A Servo myservob; // works on motor B Servo myservoc;

More information

المعروضة ضمن الفديو. Serial.print("Current humidity = "); Serial.print(DHT.humidity ;) Serial.print("temperature = "); Serial.print(DHT.

المعروضة ضمن الفديو. Serial.print(Current humidity = ); Serial.print(DHT.humidity ;) Serial.print(temperature = ); Serial.print(DHT. االكواد جميع البرمجية لجميع المتحسسات المعروضة ضمن الفديو الدرس 1 #define dht_apin A0 // Analog Pin sensor is connected to dht DHT; void setup)( Serial.begin(9600 ;) delay(500);//delay to let system boot

More information

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

IME-100 ECE. Lab 3. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE, IME-100 ECE Lab 3 Electrical and Computer Engineering Department Kettering University 3-1 1. Laboratory Computers Getting Started i. Log-in with User Name: Kettering Student (no password required) ii.

More information

Train the Trainer Resources Hex Files Here - https://goo.gl/mqovrv

Train the Trainer Resources Hex Files Here - https://goo.gl/mqovrv In this topic you will explore the range of methods of input that the micro:bit has, and the commands used to code these inputs. Topic 3 Need Input and Output Write a list of inputs that a micro:bit has.

More information

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

PROGRAMMING ARDUINO COURSE ON ADVANCED INTERACTION TECHNIQUES. Luís Carriço FCUL 2012/13 Sources: Arduino Hands-on Workshop, SITI, Universidad Lusófona Arduino Spooky projects Basic electronics, University Pennsylvania Beginning Arduino Programming Getting Started With Arduino COURSE ON ADVANCED

More information

Arduino Programming Part 4: Flow Control

Arduino Programming Part 4: Flow Control Arduino Programming Part 4: Flow Control EAS 199B, Winter 2010 Gerald Recktenwald Portland State University gerry@me.pdx.edu Goal Make choices based on conditions in the environment Logical expressions:

More information

18-heater Arduino code

18-heater Arduino code 18-heater Arduino code Modified from original code by Charith Fernanado: http://www.inmojo.com charith@inmojo.com #include // Creation of variables volatile int idimmer=0; volatile boolean

More information

Arduino Board Design. Nicholas Skadberg 4/30/09 EE290. Dr. Pushkin Kachroo

Arduino Board Design. Nicholas Skadberg 4/30/09 EE290. Dr. Pushkin Kachroo Arduino Board Design Nicholas Skadberg 4/30/09 EE290 Dr. Pushkin Kachroo Abstract In an effort to further understand the concept of digital control using a microprocessor, a simple serial output device

More information

URM06 UART Ultrasonic SKU:SEN0150

URM06 UART Ultrasonic SKU:SEN0150 URM06 UART Ultrasonic SKU:SEN0150 URM06-UART Ultrasonic Introduction Ultrasonic sensors emit ultrasonic pulses, and by measuring the time of ultrasonic pulse reaches the object and back to the transducer,

More information

RB-Dfr-12 DFRobot URM04 v2.0 Ultrasonic Sensor

RB-Dfr-12 DFRobot URM04 v2.0 Ultrasonic Sensor RB-Dfr-12 DFRobot URM04 v2.0 Ultrasonic Sensor URM04 is developed based upon our popular URM37 ultrasonic sensor. The RS485 interface allows a number of sensors working together. Up to 32 URM04 may be

More information

Control Tone with IR Remote

Control Tone with IR Remote Lesson 17 Lesson 17: Control Tone with IR Remote Control Tone with IR Remote The Big Idea: The ability to detect and decode Sony-protocol infrared messages, which was explored in Lesson 16, can be added

More information

arduino programming notebook brian w. evans revised by Paul Badger

arduino programming notebook brian w. evans revised by Paul Badger arduino programming notebook brian w. evans revised by Paul Badger Arduino Programming Notebook Written and compiled by Brian W. Evans With information or inspiration taken from: http://www.arduino.cc

More information

Inclusions required for the DMD

Inclusions required for the DMD Sketch for Home Alert The sketch is not large in terms of the line count, but it almost exhausts the Uno s available flash memory thanks to all the included libraries. There is lots of room for memory

More information

Button Input: On/off state change

Button Input: On/off state change Button Input: On/off state change Living with the Lab Gerald Recktenwald Portland State University gerry@pdx.edu User input features of the fan Potentiometer for speed control Continually variable input

More information

Export: Copyright by Joy-IT - Published under CC BY-NC-SA 3.0

Export: Copyright by Joy-IT - Published under CC BY-NC-SA 3.0 Export: 29.04.2016 Copyright by Joy-IT - Published under CC BY-NC-SA 3.0 Dear customer, thank you for purchasing our product. This high quality sensor kit was developed especially for the popular Open-Source

More information

File: /home/kharring/sketchbook/tel pemove_v2/telescopemove_v2.ino Page 1 of 5

File: /home/kharring/sketchbook/tel pemove_v2/telescopemove_v2.ino Page 1 of 5 File: /home/kharring/sketchbook/tel pemove_v2/telescopemove_v2.ino Page 1 of 5 #include #include #include #include //Encoder Pin Definitions #define EcdrEqA_Pin

More information

Grove - PIR Motion Sensor

Grove - PIR Motion Sensor Grove - PIR Motion Sensor Introduction This is a simple to use PIR motion sensor with Grove compatible interface. This sensor allows you to sense motion, usually human movement in its range. Simply connect

More information

EP486 Microcontroller Applications

EP486 Microcontroller Applications EP486 Microcontroller Applications Topic 6 Step & Servo Motors Joystick & Water Sensors Department of Engineering Physics University of Gaziantep Nov 2013 Sayfa 1 Step Motor http://en.wikipedia.org/wiki/stepper_motor

More information

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

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process Lab 01 Arduino 程式設計實驗 Essential Arduino Programming and Digital Signal Process Arduino Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's

More information

Chapter 2 The Basic Functions

Chapter 2 The Basic Functions Chapter 2 The Basic Functions 2.1 Overview The code you learn to write for your Arduino is very similar to the code you write in any other computer language. This implies that all the basic concepts remain

More information

Sensors and Motor Control Lab

Sensors and Motor Control Lab Sensors and Motor Control Lab Individual lab report #1 October 16, 2015 Menghan Zhang TeamA Amit Agarwal Harry Golash Yihao Qian Zihao Zhang Individual progress Challenges Teamwork a) Used potentiometer

More information

RS485 Sensor Node V1.0 (SKU:DFR0233)

RS485 Sensor Node V1.0 (SKU:DFR0233) RS485 Sensor Node V1.0 (SKU:DFR0233) Contents 1 Introduction 2 Application 3 Specification 4 Pin Out 4.1 More details 5 Product Directive 6 Connecting Diagram 7 Sample Code Introduction This RS-485 Sensor

More information

LAB PROCEDURE. Lab Objectives 1. Generate a project using the GR-Sakura web compiler 2. Edit/Compile/Build/Debug the project using the web compiler

LAB PROCEDURE. Lab Objectives 1. Generate a project using the GR-Sakura web compiler 2. Edit/Compile/Build/Debug the project using the web compiler Lab Objectives 1. Generate a project using the GR-Sakura web compiler 2. Edit/Compile/Build/Debug the project using the web compiler Lab Materials Please verify you have the following materials at your

More information

COMP-202: Foundations of Programming

COMP-202: Foundations of Programming COMP-202: Foundations of Programming Lecture 3: Basic data types Jackie Cheung, Winter 2016 Review: Hello World public class HelloWorld { } public static void main(string[] args) { } System.out.println("Hello,

More information

GET YOUR DRAGONBOARD UP TO DATE

GET YOUR DRAGONBOARD UP TO DATE SAFESTOP (Instructable) A step-by-step guide on how to make this project. THINGS YOU WILL NEED DragonBoard-410c Mezzanine Shield 4 LED s 4 push bottons 4 1 Kohm resistances 4 220 ohm resistances Jumpers

More information

CP122 CS I. Chapter 6a: Iteration I

CP122 CS I. Chapter 6a: Iteration I CP122 CS I Chapter 6a: Iteration I Supreme Court ruling: Samsung's violation of Apple's iphone patents may only involve components and not whole phone Tech News! Tech News! Supreme Court ruling: Samsung's

More information

PIR Motion Sensor. Created by lady ada. Last updated on :23:34 PM UTC

PIR Motion Sensor. Created by lady ada. Last updated on :23:34 PM UTC PIR Motion Sensor Created by lady ada Last updated on 2017-10-20 10:23:34 PM UTC Guide Contents Guide Contents Overview Some Basic Stats How PIRs Work The PIR Sensor Lenses Connecting to a PIR Testing

More information

URM04 V2.0 (SKU:SEN0002)

URM04 V2.0 (SKU:SEN0002) URM04 V2.0 (SKU:SEN0002) URM04 V2.0 Figure 1: URM04 Beam Width 60 degree Contents 1 Introduction 2 Specification 3 Dimension and Pin definition 4 Communication Protocols 4.1 Set Device Address 4.2 Trigger

More information

Arduino notes 3: Digital input via buttons

Arduino notes 3: Digital input via buttons 1 Arduino notes 3: Digital input via buttons This is not a tutorial, but a collection of personal notes to remember the essentials of Arduino programming. The program fragments are snippets that represent

More information

C:\Documents and Settings\Don Florin\Desktop\electro\a-gsm\code\ 2016\Arduino_examples_092\SD_SS\SD_SS.ino

C:\Documents and Settings\Don Florin\Desktop\electro\a-gsm\code\ 2016\Arduino_examples_092\SD_SS\SD_SS.ino /* SD_SS.ino v 0.921/20160609 - a-gsm 2.064 microsd read/write/delete example utility COPYRIGHT (c) 2014-2016 Dragos Iosub / R&D Software Solutions srl ******************************IMPORTANT NOTICE*******************************************

More information

Basic Kit for Turtle 2WD SKU:ROB0118

Basic Kit for Turtle 2WD SKU:ROB0118 Basic Kit for Turtle 2WD SKU:ROB0118 From Robot Wiki Contents 1 Function Introduction 1.1 STEP 1: Assemble Robot 1.2 STEP 2: Debug Motor 1.3 STEP 3:Install Upper Plate 1.4 STEP4: Debug Ultrasonic Sensor

More information

DUAL PUSh BUTTON PLUG[v1.1]

DUAL PUSh BUTTON PLUG[v1.1] Product Manual DUAL PUSh BUTTON PLUG[v1.1] Updated on: 27th November 2017 Index About Elint Labz 2 Introduction 3 Specification 3 Variants 3 Supported cables: 4 Details 4 How to interface? 6 Example Codes

More information

/* This program now switches between Train at holt to train on its way with button press. */ //MD_MAX72xx_Message_Serial7_train

/* This program now switches between Train at holt to train on its way with button press. */ //MD_MAX72xx_Message_Serial7_train /* This program now switches between Train at holt to train on its way with button press. */ //MD_MAX72xx_Message_Serial7_train // Use the MD_MAX72XX library to scroll text on the display // // Demonstrates

More information

Rotary Encoder Basics

Rotary Encoder Basics Rotary Encoder Basics A rotary encoder has a fixed number of positions per revolution. These positions are easily felt as small clicks you turn the encoder. The Keyes module that I have has thirty of these

More information

Grove - Moisture Sensor

Grove - Moisture Sensor Grove - Moisture Sensor Introduction This Moisture Senor can be used for detecting the moisture of soil or judge if there is water around the sensor, let the plant in your garden able to reach out for

More information

//#define atdebug //uncomment this to debug serial communication with a-gsm

//#define atdebug //uncomment this to debug serial communication with a-gsm /* DTMF_RECEIVE v 0.921/20160707 - a-gsm 2.064 receive and decode DTMF example utility COPYRIGHT (c) 2014-2016 Dragos Iosub / R&D Software Solutions srl ******************************IMPORTANT NOTICE*******************************************

More information

FUNCTIONS For controlling the Arduino board and performing computations.

FUNCTIONS For controlling the Arduino board and performing computations. d i g i t a l R e a d ( ) [Digital I/O] Reads the value from a specified digital pin, either HIGH or LOW. digitalread(pin) pin: the number of the digital pin you want to read HIGH or LOW Sets pin 13 to

More information

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools MAE106 Laboratory Exercises Lab # 1 - Laboratory tools University of California, Irvine Department of Mechanical and Aerospace Engineering Goals To learn how to use the oscilloscope, function generator,

More information

PIR Motion Sensor. Created by lady ada. Last updated on :12:20 PM UTC

PIR Motion Sensor. Created by lady ada. Last updated on :12:20 PM UTC PIR Motion Sensor Created by lady ada Last updated on 2017-10-25 04:12:20 PM UTC Guide Contents Guide Contents Overview Some Basic Stats How PIRs Work The PIR Sensor Lenses Connecting to a PIR Testing

More information

ADC to I 2 C. Data Sheet. 10 Channel Analog to Digital Converter. with output via I 2 C

ADC to I 2 C. Data Sheet. 10 Channel Analog to Digital Converter. with output via I 2 C Data Sheet 10 Channel Analog to Digital Converter with output via I 2 C Introduction Many microcontroller projects involve the use of sensors like Accelerometers, Gyroscopes, Temperature, Compass, Barometric,

More information

Searching & Sorting in Java Bubble Sort

Searching & Sorting in Java Bubble Sort With the bubble sort, the basic idea is to compare adjacent values and exchange them if they are not in order. Consider the following example which shows the first pass through the algorithm. 1. Compare

More information

ZX Distance and Gesture Sensor SMD Hookup Guide

ZX Distance and Gesture Sensor SMD Hookup Guide Page 1 of 16 ZX Distance and Gesture Sensor SMD Hookup Guide Introduction The ZX Distance and Gesture Sensor is a collaboration product with XYZ Interactive. The innovative people at XYZ Interactive have

More information

Basic Kit for Turtle 2WD SKU:ROB0118

Basic Kit for Turtle 2WD SKU:ROB0118 Basic Kit for Turtle 2WD SKU:ROB0118 Function Introduction This Kit will teach you how to build a automatic obstacle - avoidance robot which is achieved on the platform of the Turtle Robot,based on ultrasonic

More information

KNOCK LOCK MAKE YOUR OWN SECRET LOCKING MECHANISM TO KEEP UNWANTED GUESTS OUT OF YOUR SPACE! Discover: input with a piezo, writing your own functions

KNOCK LOCK MAKE YOUR OWN SECRET LOCKING MECHANISM TO KEEP UNWANTED GUESTS OUT OF YOUR SPACE! Discover: input with a piezo, writing your own functions 125 KNOCK LOCK MAKE YOUR OWN SECRET LOCKING MECHANISM TO KEEP UNWANTED GUESTS OUT OF YOUR SPACE! Discover: input with a piezo, writing your own functions Time: 1 HOUR Level: Builds on projects: 1, 2, 3,

More information

Boolean Expressions and if 9/14/2007

Boolean Expressions and if 9/14/2007 Boolean Expressions and if 9/14/2007 1 Opening Discussion Do you have any questions about the quiz? Let's look at solutions to the interclass problem. Minute essay questions. What functions will we be

More information

SECONDARY SCHOOL, L-IMRIEĦEL HALF YEARLY EXAMINATIONS 2016/2017

SECONDARY SCHOOL, L-IMRIEĦEL HALF YEARLY EXAMINATIONS 2016/2017 SECONDARY SCHOOL, L-IMRIEĦEL HALF YEARLY EXAMINATIONS 2016/2017 YEAR: 10 Computing Time: 1½ Hr. Name: Class: Instructions: 1. Answer all the questions in the space provided on this paper. 2. Calculators

More information

The Big Idea: Background: About Serial

The Big Idea: Background: About Serial Lesson 6 Lesson 6: Serial Serial Input Input The Big Idea: Information coming into an Arduino sketch is called input. This lesson focuses on text in the form of characters that come from the user via the

More information

1 /* 2 DTMF_RECEIVE v 0.921/ a-gsmii 2.105/b-gsmgnss receive and decode DTMF example utility 3 COPYRIGHT (c) Dragos Iosub /

1 /* 2 DTMF_RECEIVE v 0.921/ a-gsmii 2.105/b-gsmgnss receive and decode DTMF example utility 3 COPYRIGHT (c) Dragos Iosub / 1 /* 2 DTMF_RECEIVE v 0.921/20171130 - a-gsmii 2.105/b-gsmgnss 2.105 receive and decode DTMF example utility 3 COPYRIGHT (c) 2014-2017 Dragos Iosub / R&D Software Solutions srl 4 5 ******************************IMPORTANT

More information

Interrupts Arduino, AVR, and deep dark programming secrets. What is an Interrupt?

Interrupts Arduino, AVR, and deep dark programming secrets. What is an Interrupt? Interrupts Arduino, AVR, and deep dark programming secrets What is an Interrupt? A transfer of program control that is not directed by the programmer Like a phone call in the middle of a conversation Stop

More information