Phidgets programming framework

Size: px
Start display at page:

Download "Phidgets programming framework"

Transcription

1 Phidgets programming framework IAT 351 Week 9 Lecture

2 traditional physical UI : examples Walking pad (DIUF)

3 traditional physical UI : examples Lego Mindstorms

4 traditional physical UI : examples SmartHome

5 What is Context? Any information that can be used to characterize the situation of an entity Who, what, where, when Why is it important? information, usually implicit, that applications do not have access to It s input that you don t get in a GUI

6 How to Use Context To present relevant information to someone Mobile tour guide To perform an action automatically Print to nearest printer To show an action that use can choose Want to phone the number in this ?

7 Related Work Tools for working with physical input/output devices irx Board Digital I/O boards Tini boards Arduino

8 Why is this hard? Steps Acquisition Representation Interpretation Storage Delivery Reaction Most of these steps repeated in all development.

9 Assignment 4 Sensor input and drawing energyview panel Graph with two lines: Inputs: external temperature (set with slider) Energy consumption ( compute from 3 inputs) Internal temperature : rotation sensor Lights: precision light sensor Appliances: touch sensor

10 Assignment 4 Graph with two lines: Energy consumption = sum of 1. Whether heating or cooling is needed kwh = ABS(internal temp-ext temp)* 2 Turn red if heating, blue if cooling 2. Lights (full on=2kwh, partly on=1,off=0) 3. Appliances: on = 3kwH, off = 0

11 Assignment 4 Graph with two lines: Energy consumption = sum of 1. Whether heating or cooling is needed 2. Lights (full on=2kwh, partly on=1,off=0) 3. Appliances: on = 3kwH, off = 0 Turn boxes on or off according to input H AC lights appliance

12 traditional physical UI : problems 1. Electronics (Difficult to write/debug w/o actual devices) 2. missing API 3. unsuited API (wrong abstraction level) 4. commercial target (oriented to different markets) 5. lack of simulation capabilities Hard to build

13 phidgets : goals simple devices easy to program just as widgets make GUIs easy to develop, so could phidgets make the new generation of physical user interfaces easy to develop.

14 phidgets : definition widget (1931) small mechanical device (today) windows gadget phidget (aka phydget) physical widget

15 phidgets : definition Phidgets, or physical widgets, are building blocks that help a developer construct physical user interfaces.

16 phidgets : architecture Phidget Device Device manager Simulation API

17 phidgets : architecture API Simulation Device Device manager

18 phidgets : API sensor actuator Phidget-specific properties, e.g. NumMotors Phidget-specific events, e.g. OnTag DeviceType IsAttached SerialNumber Specific phidget Generic phidget Int Count Phidget[] Item OnAttach() OnDetach() OnError() Phidgets manager

19 phidgets : java API

20 phidgets : java API

21 phidgets : programming (output) opens Phidget COM Object sets Device creates sets Application

22 phidgets : programming (input) opens Phidget COM Object starts Device creates fire events reads Listener Application

23 Handling the Phidget 3 important basic events ATTACH (USB connected) OnAttach(),attached() DETACH (USB disconnected) OnDetach(),detached() ERROR (help!) OnError(), error() Standard Java approach of listeners and adapters Specific events for each type of device E.g. rfid.ontag() for detecting an RFID tag in range

24 phidgets : programming Extend adapter Implement OnEvent methods Create OS Object Attach Listener Open connection to device Start listening

25 public class OpenIFKitExample { public static final void main(string args[]) throws Exception { InterfaceKitPhidget ik; System.out.println(Phidget.getLibraryVersion()); ik = new InterfaceKitPhidget(); ik.addattachlistener(new AttachListener() { public void attached(attachevent ae) { System.out.println("attachment of " + ae); } }); ik.adddetachlistener(new DetachListener() { public void detached(detachevent ae) { System.out.println("detachment of " + ae); } }); Basic listeners ik.adderrorlistener(new ErrorListener() { public void error(errorevent ee) { System.out.println("error event for " + ee); }); }

26 ik.addinputchangelistener(new InputChangeListener() { public void inputchanged(inputchangeevent oe) { System.out.println(oe); } }); ik.addoutputchangelistener(new OutputChangeListener() { public void outputchanged(outputchangeevent oe) { System.out.println(oe); } }); IK listeners ik.addsensorchangelistener(new SensorChangeListener() { public void sensorchanged(sensorchangeevent se) { System.out.println(se); } });

27 ik.openany(); System.out.println("waiting for InterfaceKit attachment..."); ik.waitforattachment(); System.out.println(ik.getDeviceName()); Waits until a device is plugged in Thread.sleep(500); ik.getoutputcount() Ik.getSensorCount() ik.getoutputstate(i); ik.setoutputstate(i,<true/false>); Ik.getSensorRawValue(i) Ik.getSensorValue(i)

28 Simple temperature example import com.phidgets.*; import com.phidgets.event.*; public class TemperatureExample { public static final void main(string args[]) throws Exception { TemperatureSensorPhidget tempsensor; tempsensor = new TemperatureSensorPhidget();

29 Simple temperature example : add IK listeners tempsensor.addattachlistener(new AttachListener() { public void attached(attachevent ae){ System.out.println("attachment of " + ae); } }); tempsensor.adddetachlistener(new DetachListener() { public void detached(detachevent ae) { System.out.println("detachment of " + ae); } }); tempsensor.adderrorlistener(new ErrorListener() { public void error(errorevent ee) { System.out.println("error event for " + ee); } });

30 Simple temperature example : add device listener tempsensor.addtemperaturechangelistener(new TemperatureChangeListener() { public void temperaturechanged(temperaturechangeevent oe) { System.out.println(oe); } });

31 Simple temperature example : attach device tempsensor.openany(); System.out.println("waiting for TemperatureSensor attachment..."); tempsensor.waitforattachment(); System.out.println("Serial: " + tempsensor.getserialnumber()); tempsensor.settemperaturechangetrigger(0, 0.1); Set trigger and wait for sensor input System.out.println("trigger: " + tempsensor.gettemperaturechangetrigger(0));

32 Simple temperature example : finish and tidy up } System.out.println("Outputting events. Input to stop."); System.in.read(); System.out.print("closing..."); tempsensor.close(); tempsensor = null; System.out.println(" ok"); if (false) { System.out.println("wait for finalization..."); System.gc(); } } Any console input will stop program

33 Simple temperature example : wait for input System.out.println("Serial: " + tempsensor.getserialnumber()); tempsensor.settemperaturechangetrigger(0, 0.1); System.out.println("trigger: " + tempsensor.gettemperaturechangetrigger(0)); System.out.println("Outputting events. Input to stop."); System.in.read(); Any console input will stop program

34 Simple LED example : turn on and off for (int j = 0; j < 10; j++) { for (int i = 0; i < led.getledcount(); i++) { led.setdiscreteled(i, 100); } for (int i = 0; i < led.getledcount(); i++) { led.setdiscreteled(i, 0); } }

35 Simple LED example import com.phidgets.*; import com.phidgets.event.*; public class LEDExample { public static final void main(string args[]) throws Exception { LEDPhidget led; led = new LEDPhidget();

36 Simple LED example : add IK listeners led.addattachlistener(new AttachListener() { public void attached(attachevent ae){ System.out.println("attachment of " + ae); } }); led.adddetachlistener(new DetachListener() { public void detached(detachevent ae) { System.out.println("detachment of " + ae); } }); led.adderrorlistener(new ErrorListener() { public void error(errorevent ee) { System.out.println("error event for " + ee); } });

37 Simple LED example : attach devices led.openany(); System.out.println("waiting for LED attachment..."); led.waitforattachment(); System.out.println("Serial: " + led.getserialnumber()); System.out.println("LEDs: " + led.getledcount());

38 Simple LED example : turn on and off for (int j = 0; j < 10; j++) { for (int i = 0; i < led.getledcount(); i++) { led.setdiscreteled(i, 100); } for (int i = 0; i < led.getledcount(); i++) { led.setdiscreteled(i, 0); } }

39 Simple LED example Set up listener

40 Phidgets Requirement Connection manager ID Simulation mode

41 Phidget Manager onattach() ondetach() Count Item DeviceType isattached() SerialNumber

42 Phidget Servo MotorPosition NumMotors onpositionchanged()

43 Attaching the interface kit // create the interface kit object InterfaceKitPhidget ik = new InterfaceKitPhidget(); // look for an attachment ik.openany(); // don t continue until an attachment is found ik.waitforattachment();

44 Digital Input Use the wires to hook one of the switches up to a digital input and one of the grounds (on either end of the row) The parameter is the index of the input The result is a boolean (true for on, false for off) // read the value of input 3 ik.getinputstate(3);

45 Analog Input Parameter is index of the device The result is a value between 0 and around 1000 (I m guessing the max is 1024) // get the value of the first analog device ik.getsensorvalue(0);

46 Digital Output Boolean values are used to set the output Each output has an index: 0-7 The two slots at either end are grounds // sets output 2 to high ik.setoutputstate(2, true);

47 Ugly Java Stuff: Exceptions Almost everything in the phidget package throws exceptions Solution #1: add throws Exception at the end of every method signature, including the main method Solution #2: wrap phidget calls in try/catch blocks

48 Pausing in Java If you want to pause execution of your program The parameter is time in milliseconds // pause for 2 seconds Thread.sleep(2000);

49 Drawbacks Need PC Not mobile Not easy to deploy

50 references : bibliography Greenberg S. and Fitchet C., Phidgets : Easy developement of physical interfaces through physical widgets. Proceedings of the ACM UIST 2001 Symposium. Greenberg S. and Boyle M., Customizable physical interfaces for interacting with conventional applications. Proceedings of the ACM UIST 2002 Symposium (phidget, widget) Laroussi Bouguila, Evequoz Florian, Michèle Courant, Béat Hirsbrunner. Active Walking Interface for Human-Scale Virtual Environment. HCII 05.

51 references: programming resources documentation on : C_API_Manual : basic architecture COM_API_Manual : object model (VB) Javadoc : java API, quite similar to COM For each particular phidget see its «hardware description» : Section labelled «Phidgets» on >> Documentation software introduction and tutorials : >> Documentation code examples : >> Download >> Beta >> Examples.zip >> Project / Examples

Phidgets programming framework

Phidgets programming framework Phidgets programming framework IAT 351 Week 8 Lecture/Lab 1 04.03.2008 summary : traditional physical UI examples problems phidgets goals definition architecture API java API programming applications references

More information

Ubicomp and Physical Interaction

Ubicomp and Physical Interaction Ubicomp and Physical Interaction Ubicomp? Computation embedded in the physical spaces around us Ambient intelligence Take advantage of naturally-occurring actions and activities to support people Input

More information

Ira A. Fulton School of Engineering

Ira A. Fulton School of Engineering CSE 593 Applied Project: DEVS HIL Mixed Mode Simulation 1 Ira A. Fulton School of Engineering CSE 593 Applied Project DEVS Hardware In The Loop (HIL) Mixed Mode Simulation with Bi-Directional Support Thomas

More information

Product Manual Touch Sensor

Product Manual Touch Sensor Product Manual 1129 - Touch Sensor Phidgets 1129 - Product Manual For Board Revision 0 Phidgets Inc. 2009 Contents 4 Product Features 4 Applications 4 Connections 4 Type of Measurement 5 Getting Started

More information

PhidgetInterfaceKit 8/8/8

PhidgetInterfaceKit 8/8/8 PhidgetInterfaceKit 8/8/8 Operating Systems: Windows 2000/XP/Vista, Windows CE, Linux, and Mac OS X Application Programming Interfaces (APIs): Visual Basic, VB.NET, C, C++, C#, Flash 9, Flex, Java, LabVIEW,

More information

Product Manual Motion Sensor

Product Manual Motion Sensor Product Manual 1111 - Motion Sensor Phidgets 1111 - Product Manual For Board Revision 0 Phidgets Inc. 2009 Contents 4 Product Features 4 Connections 4 Type of Measurement 5 Getting Started 5 Checking the

More information

PhidgetInterfaceKit 0/16/16

PhidgetInterfaceKit 0/16/16 1012 - PhidgetInterfaceKit 0/16/16 Programming Environment Operating Systems: Windows 2000/XP/Vista, Windows CE, Linux, and Mac OS X Programming Languages (APIs): VB6, VB.NET, C#.NET, C++, Flash 9, Flex,

More information

C API Manual. Phidget21

C API Manual. Phidget21 Phidget21 Describes the Application Program Interface (API) for each Phidget device. The API can be used by a number of languages; this manual discusses use via C and the code examples reflect this. Library

More information

Product Manual SSR Relay Board

Product Manual SSR Relay Board Product Manual 3052 - SSR Relay Board Phidgets 3052 - Product Manual For Board Revision 0 Phidgets Inc. 2009 Contents 4 Product Features 4 Connections 5 Getting Started 5 Checking the Contents 5 Connecting

More information

Product Manual Amp Current Sensor AC/DC

Product Manual Amp Current Sensor AC/DC Product Manual 1122-30 Amp Current Sensor AC/DC Phidgets 1122 - Product Manual For Board Revision 0 Phidgets Inc. 2009 Contents 4 Product Features 4 Connections 4 Type of Measurement 5 Getting Started

More information

Product Manual mA Adapter

Product Manual mA Adapter Product Manual 1132-4-20mA Adapter Phidgets 1132 - Product Manual For Board Revision 0 Phidgets Inc. 2010 Contents 4 Product Features 4 Connections 4 Type of Measurement 5 Getting Started 5 Checking the

More information

Product Manual Precision Voltage Sensor

Product Manual Precision Voltage Sensor Product Manual 1135 - Precision Voltage Sensor Phidgets 1135 - Product Manual For Board Revision 0 Phidgets Inc. 2009 Contents 4 Product Features 4 Connections 4 Type of Measurement 5 Getting Started 5

More information

Preliminary Phidget21.NET API Manual

Preliminary Phidget21.NET API Manual Preliminary Phidget21.NET API Manual Describes the Application Program Interface (API) for each Phidget device. The API can be used by a number of languages; this manual discusses use via C# and the code

More information

PhidgetInterfaceKit 0/0/4 for Board Revision 0

PhidgetInterfaceKit 0/0/4 for Board Revision 0 1014 - PhidgetInterfaceKit 0/0/4 for Board Revision 0 Programming Environment Operating Systems: Windows 2000/XP/Vista, Windows CE, Linux, and Mac OS X Programming Languages (APIs): VB6, VB.NET, C#.NET,

More information

Product Manual Dual SSR Relay Board

Product Manual Dual SSR Relay Board Product Manual 3053 - Dual SSR Relay Board Phidgets 3053 - Product Manual For Board Revision 0 Phidgets Inc. 2010 Contents 4 Product Features 4 Connections 5 Getting Started 5 Checking the Contents 5 Connecting

More information

Product Manual Dual Relay Board

Product Manual Dual Relay Board Product Manual 3051 - Dual Relay Board Phidgets 3051 - Product Manual For Board Revision 1 Phidgets Inc. 2009 Contents 4 Product Features 4 Connections 5 Getting Started 5 Checking the Contents 5 Connecting

More information

Humidity/Temperature Sensor

Humidity/Temperature Sensor 1125 Humidity/Temperature Sensor Product Features Measures Relative Humidity from 10% to 95% Operates over 0% to 100% Relative Humidity Accurately measures ambient temperatures from -40 C to +100 C (-40

More information

1.00 Lecture 29. Sensors and Threads. Reading for next time: Numerical Recipes (online)

1.00 Lecture 29. Sensors and Threads. Reading for next time: Numerical Recipes (online) 1.00 Lecture 29 Sensors and Threads Reading for next time: Numerical Recipes 32-36 (online) http://www.nrbook.com/a/bookcpdf.php Threads and Sensors When sensors send events to a Java program, a SensorChangeEvent

More information

Product Manual Precision Voltage Sensor

Product Manual Precision Voltage Sensor Product Manual 1135 - Precision Voltage Sensor Phidgets 1135 - Product Manual For Board Revision 0 Phidgets Inc. 2009 Contents 4 Product Features 4 Connections 4 Type of Measurement 5 Getting Started 5

More information

Preliminary .NET API Manual

Preliminary .NET API Manual Preliminary.NET API Manual Describes the Application Program Interface (API) for each Phidget device. The API can be used by a number of languages; this manual discusses use via C# and the code examples

More information

PhidgetTextLCD with 8/8/8

PhidgetTextLCD with 8/8/8 PhidgetTextLCD with 8/8/8 Phidgets are the most user-friendly system available for controlling and sensing the environment from your computer. People with absolutely no hardware knowledge or experience

More information

Product Manual IR Distance Adapter

Product Manual IR Distance Adapter Product Manual 1101 - IR Distance Adapter Phidgets 1101 - Product Manual For Board Revision 0 Phidgets Inc. 2009 Contents 4 Product Features 4 Applications 4 Connections 4 Type of Measurement 5 Getting

More information

Product Manual FlexiForce Adapter

Product Manual FlexiForce Adapter Product Manual 1120 - FlexiForce Adapter Phidgets 1120 - Product Manual For Board Revision 0 Phidgets Inc. 2009 Contents 4 Product Features 4 Connections 4 Type of Measurement 5 Getting Started 5 Checking

More information

Product Manual ph/orp Adapter

Product Manual ph/orp Adapter Product Manual 1130 - ph/orp Adapter Phidgets 1130 - Product Manual For Board Revision 0 Phidgets Inc. 2009 Contents 4 Product Features 4 Connections 4 Type of Measurement 5 Getting Started 5 Checking

More information

Recitation 9 Stream and Phidget

Recitation 9 Stream and Phidget 1.00/1.001/1.002 Introduction to Computers and Engineering Problem Solving Recitation 9 Stream and Phidget April 23-24, 2012 1 Outline Streams Phidgets 2 Streams Overview Java programs communicate with

More information

Product Manual PhidgetRFID

Product Manual PhidgetRFID Product Manual 1023 - PhidgetRFID Phidgets 9999 - Product Manual For Board Revision 1 Phidgets Inc. 2009 Contents 5 Product Features 5 Programming Environment 5 Connection 6 Getting Started 6 Checking

More information

Microcontroller Basics

Microcontroller Basics Microcontroller Basics Gabe Cohn CSE 599U February 6, 2012 www.gabeacohn.com/teaching/micro Outline Overview of Embedded Systems What is a Microcontroller? Microcontroller Features Common Microcontrollers

More information

Lecture 2. COMP1406/1006 (the Java course) Fall M. Jason Hinek Carleton University

Lecture 2. COMP1406/1006 (the Java course) Fall M. Jason Hinek Carleton University Lecture 2 COMP1406/1006 (the Java course) Fall 2013 M. Jason Hinek Carleton University today s agenda a quick look back (last Thursday) assignment 0 is posted and is due this Friday at 2pm Java compiling

More information

ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL

ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL 1 Preface About RobotLinking RobotLinking is a technology company focused on 3D Printer, Raspberry Pi and Arduino open source community development.

More information

CP122 CS I. Iteration

CP122 CS I. Iteration CP122 CS I Iteration Tech News! Pix2Pix: machine learning translation of images https://affinelayer.com/pixsrv/ Tech News! Pix2Pix: machine learning translation of images https://affinelayer.com/pixsrv/

More information

Concurrency and Java Programming

Concurrency and Java Programming Concurrency and Java Programming What is Concurrent Programming? Concurrent programming involves using features of the Java VM that allow parts of your program to run in parallel with each other. This

More information

Product Manual PhidgetTemperatureSensor 1-Input

Product Manual PhidgetTemperatureSensor 1-Input Product Manual 1051 - PhidgetTemperatureSensor 1-Input Phidgets 1051 - Product Manual For Board Revision 2 Phidgets Inc. 2010 Contents 5 Product Features 5 Programming Environment 5 Connection 6 Getting

More information

PhidgetStepper Unipolar 4-Motor

PhidgetStepper Unipolar 4-Motor 1062 - PhidgetStepper Unipolar 4-Motor Product Features The PhidgetStepper Unipolar 4-Motor allows you to control the position, velocity, and acceleration of up to 4 unipolar stepper motors. The 1062 can

More information

Selected Questions from by Nageshwara Rao

Selected Questions from  by Nageshwara Rao Selected Questions from http://way2java.com by Nageshwara Rao Swaminathan J Amrita University swaminathanj@am.amrita.edu November 24, 2016 Swaminathan J (Amrita University) way2java.com (Nageshwara Rao)

More information

Prototyping & Engineering Electronics Kits Basic Kit Guide

Prototyping & Engineering Electronics Kits Basic Kit Guide Prototyping & Engineering Electronics Kits Basic Kit Guide odysseyboard.com Please refer to www.odysseyboard.com for a PDF updated version of this guide. Guide version 1.0, February, 2018. Copyright Odyssey

More information

13 th Windsor Regional Secondary School Computer Programming Competition

13 th Windsor Regional Secondary School Computer Programming Competition SCHOOL OF COMPUTER SCIENCE 13 th Windsor Regional Secondary School Computer Programming Competition Hosted by The School of Computer Science, University of Windsor WORKSHOP I [ Overview of the Java/Eclipse

More information

COMP163. Introduction to Computer Programming. Introduction and Overview of the Hardware

COMP163. Introduction to Computer Programming. Introduction and Overview of the Hardware COMP163 Introduction to Computer Programming Introduction and Overview of the Hardware Reading Read chapter 1 of the online textbook What is the difference between a simple calculator and a computer? Hardware

More information

EK307 Lab: Microcontrollers

EK307 Lab: Microcontrollers EK307 Lab: Microcontrollers Laboratory Goal: Program a microcontroller to perform a variety of digital tasks. Learning Objectives: Learn how to program and use the Atmega 323 microcontroller Suggested

More information

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch Problem Solving Creating a class from scratch 1 Recipe for Writing a Class 1. Write the class boilerplate stuff 2. Declare Fields 3. Write Creator(s) 4. Write accessor methods 5. Write mutator methods

More information

Today. Robotics and Autonomous Systems. The scenario (again) Basic control loop

Today. Robotics and Autonomous Systems. The scenario (again) Basic control loop Today Robotics and Autonomous Systems Lecture 3 Programming robots Richard Williams Department of Computer Science University of Liverpool Before the labs start on Monday, we will look a bit at programming

More information

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University 9/5/6 CS Introduction to Computing II Wayne Snyder Department Boston University Today: Arrays (D and D) Methods Program structure Fields vs local variables Next time: Program structure continued: Classes

More information

Documen(ng code, Javadoc, Defensive Programming, Asserts, Excep(ons & Try/Catch

Documen(ng code, Javadoc, Defensive Programming, Asserts, Excep(ons & Try/Catch Documen(ng code, Javadoc, Defensive Programming, Asserts, Excep(ons & Try/Catch 1 Most important reason to comment A) To summarize the code B) To explain how the code works C) To mark loca(ons that need

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

CS 455 Midterm Exam 1 Fall 2016 [Bono] Thursday, Sept. 29, 2016

CS 455 Midterm Exam 1 Fall 2016 [Bono] Thursday, Sept. 29, 2016 Name: USC NetID (e.g., ttrojan): CS 455 Midterm Exam 1 Fall 2016 [Bono] Thursday, Sept. 29, 2016 There are 5 problems on the exam, with 56 points total available. There are 10 pages to the exam (5 pages

More information

TA0139 USER MANUAL ARDUINO 2 WHEEL DRIVE WIRELESS BLUETOOTH ROBOT KIT

TA0139 USER MANUAL ARDUINO 2 WHEEL DRIVE WIRELESS BLUETOOTH ROBOT KIT TA0139 USER MANUAL ARDUINO 2 WHEEL DRIVE WIRELESS BLUETOOTH ROBOT KIT I Contents Overview TA0139... 1 Getting started: Arduino 2 Wheel Drive Wireless Bluetooth Robot Kit using Arduino UNO... 1 2.1. What

More information

Product Manual PhidgetAccelerometer 3-Axis

Product Manual PhidgetAccelerometer 3-Axis Product Manual 1059 - PhidgetAccelerometer 3-Axis Phidgets 9999 - Product Manual For Board Revision 0 Phidgets Inc. 2009 Contents 4 Product Features 4 Programming Environment 4 Connection 5 Getting Started

More information

CS 455 Midterm Exam 1 Fall 2013 [Bono] Wednesday, Oct. 2, 2013

CS 455 Midterm Exam 1 Fall 2013 [Bono] Wednesday, Oct. 2, 2013 Name: USC loginid (e.g., ttrojan): CS 455 Midterm Exam 1 Fall 2013 [Bono] Wednesday, Oct. 2, 2013 There are 5 problems on the exam, with 53 points total available. There are 8 pages to the exam, including

More information

THREADS & CONCURRENCY

THREADS & CONCURRENCY 27/04/2018 Sorry for the delay in getting slides for today 2 Another reason for the delay: Yesterday: 63 posts on the course Piazza yesterday. A7: If you received 100 for correctness (perhaps minus a late

More information

PROGRAMMING ROBOTS AN ABSTRACT VIEW

PROGRAMMING ROBOTS AN ABSTRACT VIEW ROBOTICS AND AUTONOMOUS SYSTEMS Simon Parsons Department of Computer Science University of Liverpool LECTURE 3 comp329-2013-parsons-lect03 2/50 Today Before the labs start on Monday, we will look a bit

More information

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018 StenBOT Robot Kit 1 Stensat Group LLC, Copyright 2018 Legal Stuff Stensat Group LLC assumes no responsibility and/or liability for the use of the kit and documentation. There is a 90 day warranty for the

More information

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics COMP-202 Unit 1: Introduction Announcements Did you miss the first lecture? Come talk to me after class. If you want

More information

Java using LEGO Mindstorms and LeJOS. University of Idaho

Java using LEGO Mindstorms and LeJOS. University of Idaho Java using LEGO Mindstorms and LeJOS University of Idaho 2 Contents 1 Introduction 1 1.1 Setting up Java and Eclipse................................ 1 1.2 Setting up the Lego Brick to work with LeJOS.....................

More information

Lecture Notes CPSC 224 (Spring 2012) Today... Java basics. S. Bowers 1 of 8

Lecture Notes CPSC 224 (Spring 2012) Today... Java basics. S. Bowers 1 of 8 Today... Java basics S. Bowers 1 of 8 Java main method (cont.) In Java, main looks like this: public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World!"); Q: How

More information

Lesson 3: Accepting User Input and Using Different Methods for Output

Lesson 3: Accepting User Input and Using Different Methods for Output Lesson 3: Accepting User Input and Using Different Methods for Output Introduction So far, you have had an overview of the basics in Java. This document will discuss how to put some power in your program

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

SILENCING AN ALARM. When the alarm bell or siren is sounding, enter your user code or present your keyfob to your keypad.

SILENCING AN ALARM. When the alarm bell or siren is sounding, enter your user code or present your keyfob to your keypad. S Y S T E M U S E R G U I D E SILENCING AN ALARM When the alarm bell or siren is sounding, enter your user code or present your keyfob to your keypad. IS THIS A FALSE ALARM? YES NO displays. REAL ALARM

More information

C212 Early Evaluation Exam Mon Feb Name: Please provide brief (common sense) justifications with your answers below.

C212 Early Evaluation Exam Mon Feb Name: Please provide brief (common sense) justifications with your answers below. C212 Early Evaluation Exam Mon Feb 10 2014 Name: Please provide brief (common sense) justifications with your answers below. 1. What is the type (and value) of this expression: 5 * (7 + 4 / 2) 2. What

More information

Lecture 22: Java. Overall Structure. Classes & Objects. Every statement must end with ';' Carl Kingsford, , Fall 2015

Lecture 22: Java. Overall Structure. Classes & Objects. Every statement must end with ';' Carl Kingsford, , Fall 2015 Carl Kingsford, 0-0, Fall 0 Lecture : Java Overall Structure Classes & Objects Every function in Java must be inside a class, which are similar to Go's struct s. For example: 8 9 0 8 9 class MyProgram

More information

THREADS AND CONCURRENCY

THREADS AND CONCURRENCY THREADS AND CONCURRENCY Lecture 22 CS2110 Spring 2013 Graphs summary 2 Dijkstra: given a vertex v, finds shortest path from v to x for each vertex x in the graph Key idea: maintain a 5-part invariant on

More information

INDEX. A SIMPLE JAVA PROGRAM Class Declaration The Main Line. The Line Contains Three Keywords The Output Line

INDEX. A SIMPLE JAVA PROGRAM Class Declaration The Main Line. The Line Contains Three Keywords The Output Line A SIMPLE JAVA PROGRAM Class Declaration The Main Line INDEX The Line Contains Three Keywords The Output Line COMMENTS Single Line Comment Multiline Comment Documentation Comment TYPE CASTING Implicit Type

More information

LECTURE 2 (Gaya College of Engineering)

LECTURE 2 (Gaya College of Engineering) LECTURE 2 (Gaya College of Engineering) 1) CHARACTERISTICS OF OBJECTS: Object is an instance of a class. So, it is an active entity. Objects have three basic characteristics. They are- State: An object

More information

CS 211: Methods, Memory, Equality

CS 211: Methods, Memory, Equality CS 211: Methods, Memory, Equality Chris Kauffman Week 2-1 So far... Comments Statements/Expressions Variable Types little types, what about Big types? Assignment Basic Output (Input?) Conditionals (if-else)

More information

SSP ROBOT DESIGN A. DEAN 11/29/05 LAB: ROBOT OBJECTS IN LEJOS

SSP ROBOT DESIGN A. DEAN 11/29/05 LAB: ROBOT OBJECTS IN LEJOS SSP 100.9 ROBOT DESIGN A. DEAN 11/29/05 LAB: ROBOT OBJECTS IN LEJOS As we saw in class last Tuesday (well, as at least a few of us saw the rest should check the web for the slides), everything in Java

More information

Today. Robotics and Autonomous Systems. Today. Communication on the NXT. Lecture 14: Communication and other useful things.

Today. Robotics and Autonomous Systems. Today. Communication on the NXT. Lecture 14: Communication and other useful things. Today Robotics and Autonomous Systems Lecture 14: Communication and other useful things Richard Williams Department of Computer Science University of Liverpool We will cover things from all parts of robotics

More information

Robotics and Autonomous Systems

Robotics and Autonomous Systems Robotics and Autonomous Systems Lecture 14: Communication and other useful things Simon Parsons Department of Computer Science University of Liverpool 1 / 43 Today We will cover things from all parts of

More information

Design Tools. michael bernstein spring cs376.stanford.edu

Design Tools. michael bernstein spring cs376.stanford.edu Design Tools michael bernstein spring 2013 cs376.stanford.edu Design tools should... [Hartmann, PhD thesis 09] Decrease UI construction time Isolate designers from implementation details Enable designers

More information

Object-Oriented Design Lecture 3 CSU 370 Fall 2007 (Pucella) Friday, Sep 14, 2007

Object-Oriented Design Lecture 3 CSU 370 Fall 2007 (Pucella) Friday, Sep 14, 2007 Object-Oriented Design Lecture 3 CSU 370 Fall 2007 (Pucella) Friday, Sep 14, 2007 Java We will be programming in Java in this course. Partly because it is a reasonable language, and partly because you

More information

6.092: Java for 6.170

6.092: Java for 6.170 6.092: Java for 6.170 Lucy Mendel MIT EECS MIT 6.092 IAP 2006 1 Course Staff Lucy Mendel Corey McCaffrey Rob Toscano Justin Mazzola Paluska Scott Osler Ray He Ask us for help! MIT 6.092 IAP 2006 2 Class

More information

This is a tutorial about sensing the environment using a Raspberry Pi. measure a digital input (from a button) output a digital signal (to an LED)

This is a tutorial about sensing the environment using a Raspberry Pi. measure a digital input (from a button) output a digital signal (to an LED) Practical 2 - Overview This is a tutorial about sensing the environment using a Raspberry Pi and a GrovePi+. You will learn: digital input and output measure a digital input (from a button) output a digital

More information

Configuring the LI-1400 Datalogger for Illuminance and Irradiance Studies

Configuring the LI-1400 Datalogger for Illuminance and Irradiance Studies Application Note Configuring the LI-1400 Datalogger for Illuminance and Irradiance Studies Introduction This document describes how to configure and deploy the LI-COR LI-1400 Datalogger (Figure 1) and

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

COMMUNICATION AND OTHER USEFUL THINGS

COMMUNICATION AND OTHER USEFUL THINGS ROBOTICS AND AUTONOMOUS SYSTEMS Simon Parsons Department of Computer Science University of Liverpool LECTURE 14 comp329-2013-parsons-lect14 2/42 Today We will cover things from all parts of robotics COMMUNICATION

More information

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software.

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software. Introduction to Netbeans This document is a brief introduction to writing and compiling a program using the NetBeans Integrated Development Environment (IDE). An IDE is a program that automates and makes

More information

Product Manual PhidgetSpatial 0/0/3. Accelerometer 3-Axis 5G

Product Manual PhidgetSpatial 0/0/3. Accelerometer 3-Axis 5G Product Manual 1049 - PhidgetSpatial 0/0/3 Accelerometer 3-Axis 5G Phidgets 1049 - Product Manual For Board Revision 0 Phidgets Inc. 2010 Contents 5 Product Features 5 Programming Environment 5 Connection

More information

You will need to collect samples of external documentation that is not software related--directions to build; manual for TV, etc.

You will need to collect samples of external documentation that is not software related--directions to build; manual for TV, etc. Teacher Notes This lesson focuses on documentation specific to software. Since students are not developing any software in this unit you may prefer to delay the presentation of the material in this lesson.

More information

Controls Structure for Repetition

Controls Structure for Repetition Controls Structure for Repetition So far we have looked at the if statement, a control structure that allows us to execute different pieces of code based on certain conditions. However, the true power

More information

Widgets. Widgets Widget Toolkits. User Interface Widget

Widgets. Widgets Widget Toolkits. User Interface Widget Widgets Widgets Widget Toolkits 2.3 Widgets 1 User Interface Widget Widget is a generic name for parts of an interface that have their own behavior: buttons, drop-down menus, spinners, file dialog boxes,

More information

Exceptions vs. Errors Exceptions vs. RuntimeExceptions try...catch...finally throw and throws

Exceptions vs. Errors Exceptions vs. RuntimeExceptions try...catch...finally throw and throws Lecture 14 Summary Exceptions vs. Errors Exceptions vs. RuntimeExceptions try...catch...finally throw and throws 1 By the end of this lecture, you will be able to differentiate between errors, exceptions,

More information

ITEC1620 Object-Based Programming. Lecture 13

ITEC1620 Object-Based Programming. Lecture 13 ITEC1620 Object-Based Programming Lecture 13 References A Simple Class AnInt objecta = new AnInt(); AnInt objectb = new AnInt(); objecta objectb AnInt AnInt value value Value Assignments objecta.value

More information

APPLICATION DEVELOPMENT

APPLICATION DEVELOPMENT APPLICATION DEVELOPMENT LECTURE 1: INTRODUCTION class AppDev { } Part of SmartProducts INTRODUCTION APPLICATION DEVELOPMENT Intro to course Java Eclipse Assignment Fjodor van Slooten W241 (Horst-wing West)

More information

COMP 215: INTRO TO PROGRAM DESIGN. Prof. Chris Jermaine Chris Prof. Chris Dr. Chris

COMP 215: INTRO TO PROGRAM DESIGN. Prof. Chris Jermaine Chris Prof. Chris Dr. Chris COMP 215: INTRO TO PROGRAM DESIGN Prof. Chris Jermaine cmj4@cs.rice.edu Chris Prof. Chris Dr. Chris 1 This Class 50% of content: modern programming and program design The Java programming language will

More information

Arrays. COMS W1007 Introduction to Computer Science. Christopher Conway 10 June 2003

Arrays. COMS W1007 Introduction to Computer Science. Christopher Conway 10 June 2003 Arrays COMS W1007 Introduction to Computer Science Christopher Conway 10 June 2003 Arrays An array is a list of values. In Java, the components of an array can be of any type, basic or object. An array

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

Exception Handling. Sometimes when the computer tries to execute a statement something goes wrong:

Exception Handling. Sometimes when the computer tries to execute a statement something goes wrong: Exception Handling Run-time errors The exception concept Throwing exceptions Handling exceptions Declaring exceptions Creating your own exception Ariel Shamir 1 Run-time Errors Sometimes when the computer

More information

CS122 Lecture: Reuse, Components, Frameworks and APIs

CS122 Lecture: Reuse, Components, Frameworks and APIs Objectives: CS122 Lecture: Reuse, Components, Frameworks and APIs 1. To introduce the basic concept of re-use 2. To introduce the notion of component-based software engineering 3. To introduce the notion

More information

Lecture 17. Instructor: Craig Duckett. Passing & Returning Arrays

Lecture 17. Instructor: Craig Duckett. Passing & Returning Arrays Lecture 17 Instructor: Craig Duckett Passing & Returning Arrays Assignment Dates (By Due Date) Assignment 1 (LECTURE 5) GRADED! Section 1: Monday, January 22 nd Assignment 2 (LECTURE 8) GRADED! Section

More information

Tutorial: Making Legobot Move Steering Command Brighton H.S Engineering By: Matthew Jourden

Tutorial: Making Legobot Move Steering Command Brighton H.S Engineering By: Matthew Jourden Tutorial: Making Legobot Move Steering Command Brighton H.S Engineering By: Matthew Jourden 1. Build Bas Robot. See Build Manual in the Lego Core Set Kit for details or Build Instructions Base Robot File

More information

Object-Oriented Programming Classes, Objects, Variables

Object-Oriented Programming Classes, Objects, Variables Object-Oriented Programming Classes, Objects, Variables Ewan Klein School of Informatics Inf1 :: 2009/10 Ewan Klein (School of Informatics) Object-Oriented ProgrammingClasses, Objects, Variables Inf1 ::

More information

Connecting Arduino to Processing a

Connecting Arduino to Processing a Connecting Arduino to Processing a learn.sparkfun.com tutorial Available online at: http://sfe.io/t69 Contents Introduction From Arduino......to Processing From Processing......to Arduino Shaking Hands

More information

Exception Handling. Run-time Errors. Methods Failure. Sometimes when the computer tries to execute a statement something goes wrong:

Exception Handling. Run-time Errors. Methods Failure. Sometimes when the computer tries to execute a statement something goes wrong: Exception Handling Run-time errors The exception concept Throwing exceptions Handling exceptions Declaring exceptions Creating your own exception 22 November 2007 Ariel Shamir 1 Run-time Errors Sometimes

More information

Phidgets: Easy Development of Physical Interfaces through Physical Widgets

Phidgets: Easy Development of Physical Interfaces through Physical Widgets Phidgets: Easy Development of Physical Interfaces through Physical Widgets Saul Greenberg and Chester Fitchett Department of Computer Science University of Calgary Calgary, Alberta, Canada T2N 1N4 Tel:

More information

Project Planning. Module 4: Practice Exercises. Academic Services Unit PREPARED BY. August 2012

Project Planning. Module 4: Practice Exercises. Academic Services Unit PREPARED BY. August 2012 Project Planning PREPARED BY Academic Services Unit August 2012 Applied Technology High Schools, 2012 Module Objectives Upon successful completion of this module, students should be able to: 1. Select

More information

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette COMP 250: Java Programming I Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette Variables and types [Downey Ch 2] Variable: temporary storage location in memory.

More information

Page 1. Human-computer interaction. Lecture 1b: Design & Implementation. Building user interfaces. Mental & implementation models

Page 1. Human-computer interaction. Lecture 1b: Design & Implementation. Building user interfaces. Mental & implementation models Human-computer interaction Lecture 1b: Design & Implementation Human-computer interaction is a discipline concerned with the design, implementation, and evaluation of interactive systems for human use

More information

CS 11 java track: lecture 3

CS 11 java track: lecture 3 CS 11 java track: lecture 3 This week: documentation (javadoc) exception handling more on object-oriented programming (OOP) inheritance and polymorphism abstract classes and interfaces graphical user interfaces

More information

CIS November 14, 2017

CIS November 14, 2017 CIS 1068 November 14, 2017 Administrative Stuff Netflix Challenge New assignment posted soon Lab grades Last Time. Building Our Own Classes Why Abstraction More on the new operator Fields Class vs the

More information

CIS 1068 Netflix Challenge New assignment posted soon Lab grades November 14, 2017

CIS 1068 Netflix Challenge New assignment posted soon Lab grades November 14, 2017 Administrative Stuff CIS 1068 Netflix Challenge New assignment posted soon Lab grades November 14, 2017 Last Time. Building Our Own Classes Why Abstraction More on the new operator Fields Class vs the

More information

CS111: PROGRAMMING LANGUAGE II

CS111: PROGRAMMING LANGUAGE II 1 CS111: PROGRAMMING LANGUAGE II Computer Science Department Lecture 1: Introduction Lecture Contents 2 Course info Why programming?? Why Java?? Write once, run anywhere!! Java basics Input/output Variables

More information

Arrays. Eng. Mohammed Abdualal

Arrays. Eng. Mohammed Abdualal Islamic University of Gaza Faculty of Engineering Computer Engineering Department Computer Programming Lab (ECOM 2114) Created by Eng: Mohammed Alokshiya Modified by Eng: Mohammed Abdualal Lab 9 Arrays

More information

Droide Multi Language Platform. NXT S.D.K. - Java Documentation 2.1.8

Droide Multi Language Platform. NXT S.D.K. - Java Documentation 2.1.8 Droide Multi Language Platform NXT S.D.K. - Java Documentation 2.1.8 May 31, 2008 1 Introduction This document is intended to be used as the Java API documentation. Here you can nd a small technical description

More information