genie.attacheventhandler(mygenieeventhandler); // Attach the user function Event Handler for processing events

Size: px
Start display at page:

Download "genie.attacheventhandler(mygenieeventhandler); // Attach the user function Event Handler for processing events"

Transcription

1 #include <Event.h> #include <Timer.h> #include <geniearduino.h> //#include <EEPROM.h> Genie genie; #define RESETLINE 4 Timer t1,t4,t2; int needsave = 1; int timesince = 0; int pulses, A_SIG = 0, B_SIG = 1; #define CHANNEL1 11 #define CHANNEL2 12 #define CHANNEL3 7 #define VoltagePin int repeatdistance = 0; int previoustargetheight = 0; int now = 0; int next =0; int last =0; int battpercentage=0; float battvoltage=0; void setup() attachinterrupt(0, A_RISE, RISING); // interupts for counting encoder attachinterrupt(1, B_RISE, RISING); pinmode(channel1, OUTPUT); // outputs for relay control pinmode(channel2, OUTPUT); pinmode(channel3, OUTPUT); pinmode(13, OUTPUT); pinmode(9, INPUT_PULLUP); //SET BUTTON INPUT PINS AND PULLUPRESISTORS digitalwrite (9, HIGH); pinmode(10, INPUT_PULLUP); digitalwrite (10, HIGH); pinmode(8, INPUT_PULLUP); digitalwrite (8, HIGH); Serial.begin(200000); // (200K) Baud genie.begin(serial); // Use Serial0 for talking to the Genie Library, and to the 4D Systems display genie.attacheventhandler(mygenieeventhandler); // Attach the user function Event Handler for processing events pinmode(resetline, OUTPUT); // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset) digitalwrite(resetline, 1); // Reset the Display via D4 delay(100); digitalwrite(resetline, 0); // unreset the Display via D4 delay (4000); //let the display start up after the reset (This is important) genie.writecontrast(15); // turns display on and sets max contrast

2 say(4, repeatdistance); genie.doevents(); // This calls the library each loop to process the queued responses from the display calibrate(); // t1.every(200, timesetter); // ads half second count to time since last button push t2.every(1000,checkvoltage); // updates the battery disply //********************************************************************************************** void loop() digitalwrite(13,!digitalread(13)); // This makes the led on the arduino blink once with each loop, to show lo genie.doevents(); // This calls the library each loop to process the queued responses from the display t1.update(); t4.update(); if ( digitalread (9) == HIGH && digitalread (10) == HIGH ) // check all button positions and update actions ac freeze(); if (digitalread (9) == LOW) goup(); pushed(); if (digitalread (10) == LOW) godown(); pushed(); if (digitalread (8) == LOW) genie.writestr(0, "going to next height"); repeat(); void A_RISE() detachinterrupt(0); A_SIG = 1; if (B_SIG == 0) if (B_SIG == 1) // Serial.println(pulses); attachinterrupt(0, A_FALL, FALLING); void A_FALL() detachinterrupt(0); A_SIG = 0; if (B_SIG == 1) if (B_SIG == 0)

3 //Serial.println(pulses); attachinterrupt(0, A_RISE, RISING); void B_RISE() detachinterrupt(1); B_SIG = 1; if (A_SIG == 1) if (A_SIG == 0) // Serial.println(pulses); attachinterrupt(1, B_FALL, FALLING); void B_FALL() detachinterrupt(1); B_SIG = 0; if (A_SIG == 0) if (A_SIG == 1) //Serial.println(pulses); attachinterrupt(1, B_RISE, RISING); //***************************************************************************should the current height be save void timesetter() timesince ++; // counts 0.2 seconds since button has not been pushed (called automatically every 0.2 second) if (needsave == 0) genie.writeobject(genie_obj_gauge, 1, timesince * 3); if (timesince > 1000) timesince = 10; // prevents this number from getting too big (called automatically once a minute void pushed() t4.after(4000, saveheight); timesince = 0; // resets the count since button has been pushed needsave = 0; //tells save height to actually save next time - meaning the height is only saved once and all genie.writestr(0, "saving in 3 seconds"); t1.update(); void saveheight() t1.update(); if (needsave == 0) genie.writestr(0, "waiting to save");

4 if (timesince > 8 && needsave == 0) //if it has been 2 seconds since a reset and there has been at least one re needsave = 1; // set the need to save height as no untill up or down is pusshed again last = now; // *now* still holds the previous stored height which is hereby transfered to the value last now = pulses; // this updates the value *now* to be correc repeatdistance = (now - last); // define repeat distance: diferance between last two saved heights next = (now + repeatdistance); // the next target height will be the actual current height plus the distance if (next > now ) genie.writeobject(genie_obj_userimages, 0,1); if (next < now ) genie.writeobject(genie_obj_userimages, 0,0); rangefinder(); // alert and avoid going past maximum extension say(4, repeatdistance); say(0,timesince); genie.writestr(0, "curent height has been saved"); genie.writeobject(genie_obj_gauge, 0x00, 0); genie.writeobject(genie_obj_sound, 0x00, 0); //***************************************************************************repeat function below************ void repeat() int directionalremainder = 0; int remainder = 9999; directionalremainder = (next - pulses); if (pulses > next) remainder = abs(directionalremainder); // are we there yet? finds distance to target height // removes negatives to give absolute distance int h = 0; for ( h = 0; remainder > 90; h ++) // move if we are not at the target height this loops until we aclose if (pulses < next ) // go up if below the target height goup(); if (pulses > next ) //go down if above target height godown(); directionalremainder = (next - pulses); // are we there yet? finds distance to target height remainder = abs(directionalremainder); // makes distance absolute (not positive or negati if (remainder < 10) // if we the height happens to be close to the target height freeze(); //before trying to get closer, the arm slows

5 delay (300); ; for ( h = 0; remainder > 6 ; h ++) //if we are almost there, pause (once after each call to repeat) allowing if (pulses < next) //keep going in same direction for a fraction of a second before stopping and checking again goup(); delay (20); if (pulses > next ) //goes down further than up, to prevent ever being caught godown(); delay(30); freeze(); delay (200); if ( remainder < 15 ) delay (400); directionalremainder = (next - pulses); // meaasures the remaining distance to *next* height so th remainder = abs(directionalremainder); // makes distance absolute (not positive or negative) freeze(); // remaining distance must be less than 6 now - (within 0.5mm) so actuator is stopped and screen upda last = now; now = next; repeatdistance = (now - last); // define repeat distance: diferance between last two saved heights next = (now + repeatdistance); //redefines targetheight based on genie.writestr(0, "next height has been incremented"); rangefinder(); // alert and avoid going past maximum extension say(4, repeatdistance); //update display before previous height is updated void rangefinder() if (next < 20 next > 5800) next = now; genie.writeobject(genie_obj_userimages, 0,2); genie.writestr(0, "Limit reached, please begin a new stack."); void calibrate() genie.writeobject(genie_obj_form, 2, 0); // Change to vaupel form genie.writestr(10,"calibrating"); int tempheight1 = 0; int tempheight2 = 9999 ; for ( int y = 0; tempheight1!= tempheight2; y ++) // if the last two readins are different the arm is still mo tempheight1 = pulses; // set temp height to current encoder reading

6 godown(); // drives actuator down delay (500); tempheight2 = pulses; // set temp height to current encoder reading say(11, pulses); freeze(); pulses = 0; genie.writeobject(genie_obj_form, 0, 0); // Change to numbers form genie.writestr(0, "Press up to set your first height"); genie.writeobject(genie_obj_userimages, 0,1); // display up arrow for first move say(4, repeatdistance); void mygenieeventhandler(void) genieframe Event; genie.dequeueevent(&event); int slider_val = 0; //If the cmd received is from a Reported Event (Events triggered from the Events tab of Workshop4 objects) if (Event.reportObject.cmd == GENIE_REPORT_EVENT) if (Event.reportObject.object == GENIE_OBJ_SLIDER) // If the Reported Message was from a Slide if (Event.reportObject.index == 0) // If Slider0 slider_val = genie.geteventdata(&event); // Receive the event data from the Slider0 genie.writeobject(genie_obj_led_digits, 0x00, slider_val); // Write Slider0 value to to LED Digits 0 //If the cmd received is from a Reported Object, which occurs if a Read Object (genie.readoject) is requested i if (Event.reportObject.cmd == GENIE_REPORT_OBJ) if (Event.reportObject.object == GENIE_OBJ_USER_LED) // If the Reported Message was from a User if (Event.reportObject.index == 0) // If UserLed0 bool UserLed0_val = genie.geteventdata(&event); // Receive the event data from the UserLed0 UserLed0_val =!UserLed0_val; // Toggle the state of the User LED Variabl genie.writeobject(genie_obj_user_led, 0x00, UserLed0_val); // Write UserLed0_val value back to to User //This can be expanded as more objects are added that need to be captured //Event.reportObject.cmd is used to determine the command of that event, such as an reported event //Event.reportObject.object is used to determine the object type, such as a Slider //Event.reportObject.index is used to determine the index of the object, such as Slider0 //genie.geteventdata(&event) us used to save the data from the Event, into a variable. int lastaction = 99; void freeze() if (lastaction!= 0) //prevents pins being constantly set to the same value // Serial.println("freezing"); digitalwrite(channel1, LOW);

7 digitalwrite(channel2, LOW); digitalwrite(channel3, LOW); lastaction = 0; void godown() if (lastaction!= 1) // Serial.println("going down"); digitalwrite(channel1, HIGH); digitalwrite(channel2, HIGH); digitalwrite(channel3, HIGH); lastaction = 1; void goup() if (lastaction!= 2) //Serial.println("going up"); digitalwrite(channel1, HIGH); digitalwrite(channel2, LOW); digitalwrite(channel3, LOW); lastaction = 2; void say(int which, long value) char newvalue[4]; String holder; holder=string(value/30); holder.tochararray(newvalue,4); genie.writestr(which,newvalue); void pos() char newvalue[4]; String holder; holder=string(pulses/30); holder.tochararray(newvalue,4); genie.writestr(5,newvalue); void checkvoltage() battvoltage = analogread(0) *5*2.77/123; battpercentage = map (battvoltage, 11.5,13.8, 0,100); say(12, battpercentage); genie.writeobject(genie_obj_gauge, 0, battpercentage);

Microcontrollers and Interfacing week 8 exercises

Microcontrollers and Interfacing week 8 exercises 2 HARDWARE DEBOUNCING Microcontrollers and Interfacing week 8 exercises 1 More digital input When using a switch for digital input we always need a pull-up resistor. For convenience, the microcontroller

More information

MEDIS Module 2. Microcontroller based systems for controlling industrial processes. Chapter 4: Timer and interrupts. M. Seyfarth, Version 0.

MEDIS Module 2. Microcontroller based systems for controlling industrial processes. Chapter 4: Timer and interrupts. M. Seyfarth, Version 0. MEDIS Module 2 Microcontroller based systems for controlling industrial processes Chapter 4: Timer and interrupts M. Seyfarth, Version 0.1 Steuerungstechnik 1: Speicherprogrammierbare Steuerungstechnik

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

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

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

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno. This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno. Note that there are two different module types: the temperature sensor module and

More information

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

Specification. 1.Power Supply direct from Microcontroller Board. 2.The circuit can be used with Microcontroller Board such as Arduino UNO R3. Part Number : Product Name : FK-FA1410 12-LED AND 3-BOTTON SHIELD This is the experimental board for receiving and transmitting data from the port of microcontroller. The function of FK-FA1401 is fundamental

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

BASIC ARDUINO WORKSHOP. Mr. Aldwin and Mr. Bernardo

BASIC ARDUINO WORKSHOP. Mr. Aldwin and Mr. Bernardo BASIC ARDUINO WORKSHOP Mr. Aldwin and Mr. Bernardo 1 BASIC ARDUINO WORKSHOP Course Goals Introduce Arduino Hardware and Understand Input Software and Output Create simple project 2 Arduino Open-source

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

keyestudio Keyestudio MEGA 2560 R3 Board

keyestudio Keyestudio MEGA 2560 R3 Board Keyestudio MEGA 2560 R3 Board Introduction: Keyestudio Mega 2560 R3 is a microcontroller board based on the ATMEGA2560-16AU, fully compatible with ARDUINO MEGA 2560 REV3. It has 54 digital input/output

More information

How to Use an Arduino

How to Use an Arduino How to Use an Arduino By Vivian Law Introduction The first microcontroller, TMS-1802-NC, was built in 1971 by Texas Instruments. It owed its existence to the innovation and versatility of silicon and the

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

The Arduino IDE and coding in C (part 1)

The Arduino IDE and coding in C (part 1) The Arduino IDE and coding in C (part 1) Introduction to the Arduino IDE (integrated development environment) Based on C++ Latest version ARDUINO IDE 1.8.3 can be downloaded from: https://www.arduino.cc/en/main/software

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

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

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino University of Portland EE 271 Electrical Circuits Laboratory Experiment: Arduino I. Objective The objective of this experiment is to learn how to use the Arduino microcontroller to monitor switches and

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

SquareWear Programming Reference 1.0 Oct 10, 2012

SquareWear Programming Reference 1.0 Oct 10, 2012 Content: 1. Overview 2. Basic Data Types 3. Pin Functions 4. main() and initsquarewear() 5. Digital Input/Output 6. Analog Input/PWM Output 7. Timing, Delay, Reset, and Sleep 8. USB Serial Functions 9.

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

ArdOS The Arduino Operating System Quick Start Guide and Examples

ArdOS The Arduino Operating System Quick Start Guide and Examples ArdOS The Arduino Operating System Quick Start Guide and Examples Contents 1. Introduction... 1 2. Obtaining ArdOS... 2 3. Installing ArdOS... 2 a. Arduino IDE Versions 1.0.4 and Prior... 2 b. Arduino

More information

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 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 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S Overview Motivation Circuit Design and Arduino Architecture Projects Blink the LED Switch Night Lamp

More information

Electronic Brick Starter Kit

Electronic Brick Starter Kit Electronic Brick Starter Kit Getting Started Guide v1.0 by Introduction Hello and thank you for purchasing the Electronic Brick Starter Pack from Little Bird Electronics. We hope that you will find learning

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

Laboratory 3 Working with the LCD shield and the interrupt system

Laboratory 3 Working with the LCD shield and the interrupt system Laboratory 3 Working with the LCD shield and the interrupt system 1. Working with the LCD shield The shields are PCBs (Printed Circuit Boards) that can be placed over the Arduino boards, extending their

More information

Introduction to Arduino

Introduction to Arduino Introduction to Arduino Paco Abad May 20 th, 2011 WGM #21 Outline What is Arduino? Where to start Types Shields Alternatives Know your board Installing and using the IDE Digital output Serial communication

More information

Arduino - DigitalReadSerial

Arduino - DigitalReadSerial arduino.cc Arduino - DigitalReadSerial 5-6 minutes Digital Read Serial This example shows you how to monitor the state of a switch by establishing serial communication between your Arduino or Genuino and

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

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

Note. The above image and many others are courtesy of   - this is a wonderful resource for designing circuits. Robotics and Electronics Unit 2. Arduino Objectives. Students will understand the basic characteristics of an Arduino Uno microcontroller. understand the basic structure of an Arduino program. know how

More information

Schedule. Sanford Bernhardt, Sangster, Kumfer, Michalaka. 3:10-5:00 Workshop: Build a speedometer 5:15-7:30 Dinner and Symposium: Group 2

Schedule. Sanford Bernhardt, Sangster, Kumfer, Michalaka. 3:10-5:00 Workshop: Build a speedometer 5:15-7:30 Dinner and Symposium: Group 2 Schedule 8:00-11:00 Workshop: Arduino Fundamentals 11:00-12:00 Workshop: Build a follower robot 1:30-3:00 Symposium: Group 1 Sanford Bernhardt, Sangster, Kumfer, Michalaka 3:10-5:00 Workshop: Build a speedometer

More information

Robotics and Electronics Unit 5

Robotics and Electronics Unit 5 Robotics and Electronics Unit 5 Objectives. Students will work with mechanical push buttons understand the shortcomings of the delay function and how to use the millis function. In this unit we will use

More information

Arduino Part 3. Introductory Medical Device Prototyping

Arduino Part 3. Introductory Medical Device Prototyping Introductory Medical Device Prototyping Arduino Part 3, http://saliterman.umn.edu/ Department of Biomedical Engineering, University of Minnesota More Arduino Functions More functions: Math functions Trigonometry

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 and Matlab for prototyping and manufacturing

Arduino and Matlab for prototyping and manufacturing Arduino and Matlab for prototyping and manufacturing Enrique Chacón Tanarro 11th - 15th December 2017 UBORA First Design School - Nairobi Enrique Chacón Tanarro e.chacon@upm.es Index 1. Arduino 2. Arduino

More information

Installing the Forest Shuttle. Home Automation by

Installing the Forest Shuttle. Home Automation by Installing the Forest Shuttle Installing the Forest Shuttle 1 Assemble the track 2 Install the brackets and insert the track to the brackets 3 Do not attach the drapery yet, Attach the drapery after the

More information

Earthshine Design Arduino Starters Kit Manual - A Complete Beginners Guide to the Arduino. Project 13. Serial Temperature Sensor

Earthshine Design Arduino Starters Kit Manual - A Complete Beginners Guide to the Arduino. Project 13. Serial Temperature Sensor Project 13 Serial Temperature Sensor 75 Project 13 - Serial Temperature Sensor Now we are going to make use of the Temperature Sensor in your kit, the LM35DT. You will need just one component. What you

More information

// Software Version 1 = 6 settings, 2 = 18 settings // Defining Time Toggle Switch Address as (A3) // Anolog A1 for Frequency Potentiometer output

// Software Version 1 = 6 settings, 2 = 18 settings // Defining Time Toggle Switch Address as (A3) // Anolog A1 for Frequency Potentiometer output ` #include #define SoftVer 2 // Software Version 1 = 6 settings, 2 = 18 settings #define SpeedToggle A4 // Defining Speed Toggle Switch Address as (A4) #define TimeToggle A3 // Defining Time

More information

SX1509 I/O Expander Breakout Hookup Guide

SX1509 I/O Expander Breakout Hookup Guide Page 1 of 16 SX1509 I/O Expander Breakout Hookup Guide Introduction Is your Arduino running low on GPIO? Looking to control the brightness of 16 LEDs individually? Maybe blink or breathe a few autonomously?

More information

Arduino Programming. Arduino UNO & Innoesys Educational Shield

Arduino Programming. Arduino UNO & Innoesys Educational Shield Arduino Programming Arduino UNO & Innoesys Educational Shield www.devobox.com Electronic Components & Prototyping Tools 79 Leandrou, 10443, Athens +30 210 51 55 513, info@devobox.com ARDUINO UNO... 3 INNOESYS

More information

Counter & LED (LED Blink)

Counter & LED (LED Blink) 1 T.R.E. Meeting #1 Counter & LED (LED Blink) September 17, 2017 Contact Info for Today s Lesson: President Ryan Muller mullerr@vt.edu 610-573-1890 Learning Objectives: Learn how to use the basics of Arduino

More information

First Steps with IndraLogic

First Steps with IndraLogic Last Update: 28.11.02 CONTENT 1 STARTING INDRALOGIC 2 2 WRITING THE FIRST PROGRAM 2 3 A VISUALIZATION FOR THIS 6 4 START THE TARGET SYSTEM 8 5 SETTINGS FOR ESTABLISHING THE CONNECTION 8 6 START THE PROJECT

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

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

TABLE OF CONTENTS INTRODUCTION LESSONS PROJECTS

TABLE OF CONTENTS INTRODUCTION LESSONS PROJECTS TABLE OF CONTENTS INTRODUCTION Introduction to Components - Maker UNO 5 - Maker UNO Board 6 - Setting Up - Download Arduino IDE 7 - Install Maker UNO Drivers - Install Maker UNO Board Package 3 LESSONS.

More information

USER MANUAL ARDUINO I/O EXPANSION SHIELD

USER MANUAL ARDUINO I/O EXPANSION SHIELD USER MANUAL ARDUINO I/O EXPANSION SHIELD Description: Sometimes Arduino Uno users run short of pins because there s a lot of projects that requires more than 20 signal pins. The only option they are left

More information

Energia MSP-430!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1

Energia MSP-430!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1 Energia MSP-430 1 3 Energia 4 4 4 6 8 9 Energia 11 18 2 IIB Energia MSP-430 IIB C C++ 3 Energia Energia MSP-430 Windows Mac OS Linux MSP-430, http://www.energia.nu, Max OS X, windows Linux Mac OS X, energia-

More information

FUNCTIONS USED IN CODING pinmode()

FUNCTIONS USED IN CODING pinmode() FUNCTIONS USED IN CODING pinmode() Configures the specified pin to behave either as an input or an output. See the description of digital pins for details on the functionality of the pins. As of Arduino

More information

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

Smart Objects. SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi Smart Objects SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi 1 What is a Smart Object? Essentially, an object that: Senses Thinks Acts 2 Example 1 https://www.youtube.com/watch?v=6bncjd8eke0

More information

ARDUINO PRIMO. Code: A000135

ARDUINO PRIMO. Code: A000135 ARDUINO PRIMO Code: A000135 Primo combines the processing power from the Nordic nrf52 processor, an Espressif ESP8266 for WiFi, as well as several onboard sensors and a battery charger. The nrf52 includes

More information

Input Shield For Arduino SKU: DFR0008

Input Shield For Arduino SKU: DFR0008 Input Shield For Arduino SKU: DFR0008 Contents 1 Introduction 2 Specification 3 Pin Allocation 4 Sample Code1 5 Sample Code2 6 Version history Introduction The upgraded Arduino Input Shield includes a

More information

ARDUINO. By Kiran Tiwari BCT 2072 CoTS.

ARDUINO. By Kiran Tiwari BCT 2072 CoTS. ARDUINO By Kiran Tiwari BCT 2072 CoTS www.kirantiwari.com.np SO What is an Arduino? WELL!! Arduino is an open-source prototyping platform based on easy-to-use hardware and software. Why Arduino? Simplifies

More information

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

Arduino Workshop. Overview. What is an Arduino? Why Arduino? Setting up your Arduino Environment. Get an Arduino based board and usb cable Arduino Workshop Overview Arduino, The open source Microcontroller for easy prototyping and development What is an Arduino? Arduino is a tool for making computers that can sense and control more of the

More information

Laboratory 1 Introduction to the Arduino boards

Laboratory 1 Introduction to the Arduino boards Laboratory 1 Introduction to the Arduino boards The set of Arduino development tools include µc (microcontroller) boards, accessories (peripheral modules, components etc.) and open source software tools

More information

Lecture 7. Processing Development Environment (or PDE)

Lecture 7. Processing Development Environment (or PDE) Lecture 7 Processing Development Environment (or PDE) Processing Class Overview What is Processing? Installation and Intro. Serial Comm. from Arduino to Processing Drawing a dot & controlling position

More information

Arduino Programming and Interfacing

Arduino Programming and Interfacing Arduino Programming and Interfacing Stensat Group LLC, Copyright 2017 1 Robotic Arm Experimenters Kit 2 Legal Stuff Stensat Group LLC assumes no responsibility and/or liability for the use of the kit and

More information

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

Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas Physics 364 Arduino Lab 1 Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas Vithayathil/Kroll Introduction Last revised: 2014-11-12 This lab introduces you to an electronic development

More information

Chapter 6. Having fun with programming. Section 6.1 Random teacher jokes

Chapter 6. Having fun with programming. Section 6.1 Random teacher jokes (Note: If you would like to try out the code in this section, it can be copied and pasted into the IDE from the download page of the website. It is the page 106 download.) Chapter 6. Having fun with programming

More information

CTEC 1802 Embedded Programming Labs

CTEC 1802 Embedded Programming Labs CTEC 1802 Embedded Programming Labs This document is intended to get you started using the Arduino and our I/O board in the laboratory - and at home! Many of the lab sessions this year will involve 'embedded

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

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

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

Procedure: Determine the polarity of the LED. Use the following image to help: Section 2: Lab Activity Section 2.1 Getting started: LED Blink Purpose: To understand how to upload a program to the Arduino and to understand the function of each line of code in a simple program. This

More information

Coding Workshop. Learning to Program with an Arduino. Lecture Notes. Programming Introduction Values Assignment Arithmetic.

Coding Workshop. Learning to Program with an Arduino. Lecture Notes. Programming Introduction Values Assignment Arithmetic. Coding Workshop Learning to Program with an Arduino Lecture Notes Table of Contents Programming ntroduction Values Assignment Arithmetic Control Tests f Blocks For Blocks Functions Arduino Main Functions

More information

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

3. The circuit is composed of 1 set of Relay circuit. Part Number : Product Name : FK-FA1420 ONE CHANNEL 12V RELAY MODULE This is the experimental module for a relay controller as the fundamental controlling programming. It is adaptable or is able to upgrade

More information

Intermediate Programming, Spring 2017*

Intermediate Programming, Spring 2017* 600.120 Intermediate Programming, Spring 2017* Misha Kazhdan *Much of the code in these examples is not commented because it would otherwise not fit on the slides. This is bad coding practice in general

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

PROGRAMMING WITH ARDUINO

PROGRAMMING WITH ARDUINO PROGRAMMING WITH ARDUINO Arduino An open-source hardware platform based on an Atmel AVR 8-bit microcontroller and a C++ based IDE Over 300000 boards have been manufactured Arduino Due is based on a 32-bit

More information

1 Overview. 2 Basic Program Structure. 2.1 Required and Optional Parts of Sketch

1 Overview. 2 Basic Program Structure. 2.1 Required and Optional Parts of Sketch Living with the Lab Winter 2015 What s this void loop thing? Gerald Recktenwald v: February 7, 2015 gerry@me.pdx.edu 1 Overview This document aims to explain two kinds of loops: the loop function that

More information

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

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

More information

Review of the syntax and use of Arduino functions, with special attention to the setup and loop functions.

Review of the syntax and use of Arduino functions, with special attention to the setup and loop functions. Living with the Lab Fall 2011 What s this void loop thing? Gerald Recktenwald v: October 31, 2011 gerry@me.pdx.edu 1 Overview This document aims to explain two kinds of loops: the loop function that is

More information

analogwrite(); The analogwrite function writes an analog value (PWM wave) to a PWM-enabled pin.

analogwrite(); The analogwrite function writes an analog value (PWM wave) to a PWM-enabled pin. analogwrite(); The analogwrite function writes an analog value (PWM wave) to a PWM-enabled pin. Syntax analogwrite(pin, value); For example: analogwrite(2, 255); or analogwrite(13, 0); Note: Capitalization

More information

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text In this lecture embedded C program for interrupt handling

More information

ROS Interface with Low Level Control - Arduino

ROS Interface with Low Level Control - Arduino ROS Interface with Low Level Control - Arduino Welcome Dr. Ahmad Kamal Nasir 12.02.2015 Dr. Ahmad Kamal Nasir 1 Today s Objectives Introduction to Arduino Writing simple Arduino sketches Serial Communication

More information

Experiment 3. Interrupts. Hazem Selmi, Ahmad Khayyat

Experiment 3. Interrupts. Hazem Selmi, Ahmad Khayyat Experiment 3 Interrupts Hazem Selmi, Ahmad Khayyat Version 162, 24 February 2017 Table of Contents 1. Objectives........................................................................................

More information

FIRE SENSOR ROBOT USING ATMEGA8L

FIRE SENSOR ROBOT USING ATMEGA8L PROJECT REPORT MICROCONTROLLER AND APPLICATIONS ECE 304 FIRE SENSOR ROBOT USING ATMEGA8L BY AKSHAY PATHAK (11BEC1104) SUBMITTED TO: PROF. VENKAT SUBRAMANIAN PRAKHAR SINGH (11BEC1108) PIYUSH BLAGGAN (11BEC1053)

More information

Quantum Phase Isochromatic Pluckeasy

Quantum Phase Isochromatic Pluckeasy Quantum Phase Isochromatic Pluckeasy Laser Harp for short Paul Holcomb Timothy Tribby Hardware Overview IR Sensors Arduino With ATmega 1280 Motor With Rotating Mirror Laser Module Laser Harp Goals Display

More information

#include "pitches.h" #include <Wire.h> #include <avr/pgmspace.h> #include "Adafruit_Trellis.h"

#include pitches.h #include <Wire.h> #include <avr/pgmspace.h> #include Adafruit_Trellis.h #include "pitches.h" #include #include #include "Adafruit_Trellis.h" Adafruit_Trellis matrix0 = Adafruit_Trellis(); Adafruit_TrellisSet trellis = Adafruit_TrellisSet(&matrix0);

More information

GOOD MORNING SUNSHINE

GOOD MORNING SUNSHINE Item 11: Good Morning Sunshine Monday, 15 October 2018 12:30 PM GOOD MORNING SUNSHINE EXPLORE WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements

More information

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

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 23 Introduction to Arduino- II Hi. Now, we will continue

More information

Today's Lecture. Check-Off for Assignment 1 by Midnight Tonight. Assignment 2

Today's Lecture. Check-Off for Assignment 1 by Midnight Tonight. Assignment 2 6. 2 7 0 : A U T O N O M O U S R O B O T D E S I G N C O M P E T I T I O N Today's Lecture Announcements/reminders HappyBoard JoyOS Setup and example LECTURE 2: Building the Basic Robot Check-Off for Assignment

More information

ARDUINO LEONARDO ETH Code: A000022

ARDUINO LEONARDO ETH Code: A000022 ARDUINO LEONARDO ETH Code: A000022 All the fun of a Leonardo, plus an Ethernet port to extend your project to the IoT world. You can control sensors and actuators via the internet as a client or server.

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

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

Digital Design through. Arduino

Digital Design through. Arduino Digital Design through 1 Arduino G V V Sharma Contents 1 Display Control through Hardware 2 1.1 Powering the Display.................................. 2 1.2 Controlling the Display.................................

More information

Welcome to Apollo. For more information, please visit the website and select Apollo. Default Code

Welcome to Apollo. For more information, please visit the website and select Apollo.  Default Code Welcome to Apollo For more information, please visit the website and select Apollo Arduino Pins Default Code D49 LED Digital Pins digitalwrite digitalread pinmode Analog Pins analogread digitalread D33

More information

Physics 364, Fall 2012, Lab #9 (Introduction to microprocessor programming with the Arduino) Lab for Monday, November 5

Physics 364, Fall 2012, Lab #9 (Introduction to microprocessor programming with the Arduino) Lab for Monday, November 5 Physics 364, Fall 2012, Lab #9 (Introduction to microprocessor programming with the Arduino) Lab for Monday, November 5 Up until this point we have been working with discrete digital components. Every

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

AndyMark Arduino Tutorial

AndyMark Arduino Tutorial AndyMark Arduino Tutorial Tank Drive June 2014 Required: Required Software List: - Kit Arduino IDE - Robot Power Cable Kit (am-0975) RobotOpen Arduino Shield Software - Battery Base Package (am-0477) RobotOpen

More information

J. La Favre Calibrating Sharp Distance Sensors July 18, 2018

J. La Favre Calibrating Sharp Distance Sensors July 18, 2018 GEAR has a number of Sharp brand IR distance sensors that can be used to determine distance to a target object. This type of sensor can be useful for maze robot projects as well as others. Sharp offers

More information

ENGR 40M Project 3c: Switch debouncing

ENGR 40M Project 3c: Switch debouncing ENGR 40M Project 3c: Switch debouncing For due dates, see the overview handout 1 Introduction This week, you will build on the previous two labs and program the Arduino to respond to an input from the

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

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

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 cs28: Introduction to Computer Systems Lab3 K-Map Simplification for an LED-based Circuit Overview In this lab, we will build a more complex combinational circuit than the mux or sum bit of a full adder

More information

User manual. For Keenlon Rarduino.

User manual. For Keenlon Rarduino. User manual For Keenlon Rarduino Design & Executive Service Website Shanghai Keenlon Hi-Tech Co., Ltd. Techsupport@keenlon.com www.keenlon.com Contents 3 Programming software installation guide 5 Programming

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

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

GPIO CONFIGURATION. Screen Touch-Pads <LOCAL RACK> Selects the GPIO in the Local Rack (16 GPIO channels).

GPIO CONFIGURATION. Screen Touch-Pads <LOCAL RACK> Selects the GPIO in the Local Rack (16 GPIO channels). CONFIGURATION GPIO In the GPIO (General Purpose Input Output) Page you can configure all GPIO channels that are available in the Soundcraft Vi Series. To access the GPIO page, press the [MENU] key, this

More information

Progress Report week of October 22. Team 1601 Circuit Breaker Calibration. Sponsored by Carling Technologies

Progress Report week of October 22. Team 1601 Circuit Breaker Calibration. Sponsored by Carling Technologies Progress Report week of October 22 Team 1601 Circuit Breaker Calibration Sponsored by Carling Technologies Start of software Continued final tweaking to the load bank Received PSoC and MiniProg Started

More information

E11 Lecture 4: More C!!! Profs. David Money Harris & Sarah Harris Fall 2011

E11 Lecture 4: More C!!! Profs. David Money Harris & Sarah Harris Fall 2011 E11 Lecture 4: More C!!! Profs. David Money Harris & Sarah Harris Fall 2011 Outline Logistics Serial Input Physical Inputs/Outputs Randomness Operators Control Statements Logistics Logistics Tutoring hours:

More information

Product Manual. Relay Plug

Product Manual. Relay Plug Product Manual Relay Plug Updated on 24 June 2017 Index Index 1 Introduction 2 Specification 3 Operating voltage: 5V 3 Variants 4 Supported cables: 4 Details 4 How to interface? 5 Example Codes 9 Arduino

More information

Monitor your home remotely using the Arduino

Monitor your home remotely using the Arduino Monitor your home remotely using the Arduino WiFi Shield How to monitor some data in your home using precisely this Arduino WiFi shield. Along with the Arduino Uno board, the final system will form an

More information

Lab 2 - Powering the Fubarino. Fubarino,, Intro to Serial, Functions and Variables

Lab 2 - Powering the Fubarino. Fubarino,, Intro to Serial, Functions and Variables Lab 2 - Powering the Fubarino Fubarino,, Intro to Serial, Functions and Variables Part 1 - Powering the Fubarino SD The Fubarino SD is a 56 pin device. Each pin on a chipkit device falls broadly into one

More information

Arduino 6: Analog I/O part 1. Jeffrey A. Meunier University of Connecticut

Arduino 6: Analog I/O part 1. Jeffrey A. Meunier University of Connecticut Arduino 6: Analog I/O part 1 Jeffrey A. Meunier jeffm@engr.uconn.edu University of Connecticut About: How to use this document I designed this tutorial to be tall and narrow so that you can read it on

More information