Phidgets™ programming framework IAT 351 Week 8 Lecture/Lab 1 04.03.2008.

Slides:



Advertisements
Similar presentations
Module 3 Configuring Hardware on a Computer Running Windows XP Professional.
Advertisements

Chapter 11 user support. Issues –different types of support at different times –implementation and presentation both important –all need careful design.
Component Oriented Programming 1 Chapter 2 Theory of Components.
Programming Paradigms and languages
Programming Basic Concepts © Juhani Välimäki 2003.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
1 Lecture 11 Interfaces and Exception Handling from Chapters 9 and 10.
CSCI 1302 Proposals Getting Started with Phidgets.
© 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Mine Mapping Remote Communication.
1 CS 106, Winter 2009 Class 4, Section 4 Slides by: Dr. Cynthia A. Brown, Instructor section 4: Dr. Herbert G. Mayer,
1 Ubiquitous Computing CS376 Reading Summary Taemie Kim.
The Science of Digital Media Microsoft Surface 7May Metropolia University of Applied Sciences Display Technologies Seminar.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Ubiquitous Computing Computers everywhere. Agenda Old future videos
1 Toolkits for Physical Objects (TUIs) Jack Li Advanced User Interface Software November 30 Fall 2004.
OS Spring’03 Introduction Operating Systems Spring 2003.
Ubiquitous Computing Computers everywhere.
Real-Time Systems and the Aware Home Anind K. Dey Ubiquitous Computing Future Computing Environments.
1© Brad Myers Brad Myers A/05-499A: Interaction Techniques Spring, 2014 Lecture 19: Physical Gadgets and their Interaction Techniques.
DIVA Group – University of Fribourg Phidgets and the programming framework HMI Seminar Tangible User Interfaces F. Evequoz
Stanford hci group / cs376 research topics in human-computer interaction I/O Toolkits Scott Klemmer 29 November 2005.
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
SM3121 Software Technology Mark Green School of Creative Media.
Introduction to AppInventor Dr. José M. Reyes Álamo.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
報告日期 :2012/03/07 指導教授 : 蔡亮宙 報 告 者 : 吳烱華 自製率 :100%.
IHP Im Technologiepark Frankfurt (Oder) Germany IHP Im Technologiepark Frankfurt (Oder) Germany ©
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Amarino:a toolkit for the rapid prototyping of mobile ubiquitous computing Bonifaz Kaufmann and Leah Buechley MIT Media Lab High-Low Tech Group Cambridge,
Chapter 2 Network Design Essentials Instructor: Nhan Nguyen Phuong.
Ch Review1 Review Chapter Microcomputer Systems Hardware, Software, and the Operating System.
Java: Chapter 1 Computer Systems Computer Programming II.
CHAPTER FOUR COMPUTER SOFTWARE.
Building Mobile Augmented Reality Services in Pervasive Computing Environment Hiroaki Kimura Eiji Tokunaga
ST01 - Introduction 1 Introduction Lecturer: Smilen Dimitrov Sensors Technology – MED4.
Ubiquitous Computing Computers everywhere. Where are we going? What happens when the input is your car pulls into the garage, and the output is the heat.
Parallels in Tangible Interface & Web 2.0 Sharad Singh Solanki.
1 Computer Systems -- Introduction  Chapter 1 focuses on:  the structure of a Java application  basic program elements  preparing and executing a program.
PERVASIVE COMPUTING MIDDLEWARE BY SCHIELE, HANDTE, AND BECKER A Presentation by Nancy Shah.
1 Extend is a simulation tool to create models quickly, with all the blocks you need and without even having to type an equation. You can use a series.
Introduction to Computer and Computer Networking: Part I Xiangming Mu 9/16/2004.
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic.
We will talking about story of JAVA language. By Kristsada Songpartom.
An Architecture to Support Context-Aware Applications
Celluloid An interactive media sequencing language.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
Internet of Things. IoT Novel paradigm – Rapidly gaining ground in the wireless scenario Basic idea – Pervasive presence around us a variety of things.
What is Multimedia Anyway? David Millard and Paul Lewis.
SEPTEMBER 8, 2015 Computer Hardware 1-1. HARDWARE TERMS CPU — Central Processing Unit RAM — Random-Access Memory  “random-access” means the CPU can read.
Chapter 1 WHAT IS A COMPUTER Faculty of ICT & Business Management Tel : BCOMP0101 Introduction to Information Technology.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Slide design: Dr. Mark L. Hornick
Introduction to Event-Driven Programming
Google Web Toolkit Tutorial
1st Draft for Defining IoT (1)
Java programming lecture one
Application Development Theory
Programmable Logic Controllers (PLCs) An Overview.
Class Announcements 1 week left until project presentations!
3. Object-oriented Design
PLC Hardware Components.
Chapter 3 Hardware and software 1.
Chapter 3 Hardware and software 1.
Chapter 11 user support.
I/O Toolkits Scott Klemmer · 16 November 2006.
Introduction to AppInventor
Sensor Networks – Motes, Smart Spaces, and Beyond
Computing Essentials Module 1.
Computing Essentials Module 1.
Presentation transcript:

Phidgets™ programming framework IAT 351 Week 8 Lecture/Lab

Phidgets | IAT351 | summary : traditional physical UI  examples  problems phidgets  goals  definition  architecture  API  java API  programming  applications references  bibliography  programming resources

Phidgets | IAT351 | traditional physical UI : examples Walking pad (DIUF)

Phidgets | IAT351 | traditional physical UI : examples Lego Mindstorms

Phidgets | IAT351 | traditional physical UI : examples SmartHome

Phidgets | IAT351 | Motivation Pertaining to ubiquitous computing (ubicomp), two areas are relevant:  Context-aware computing  Tangible user interfaces

Phidgets | IAT351 | What remains hard? Sensing… Actuation… We’ll get back to how Phidgets address this

Phidgets | IAT351 | 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

Phidgets | IAT351 | 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 ?

Phidgets | IAT351 | Case Study: tour guides Very popular theme  Location is an easy piece of context G. Abowd et al. Cyberguide: A mobile context-aware tour guide. Balzer/ACM Wireless Networks, Vol. 3(5), 1997, pp

Phidgets | IAT351 | Simple Example: In/Out Board

Phidgets | IAT351 | Simple Example: In/Out Board Face Recognition Location Widget Location Widget In/Out Board Smart Card Reader ID to Name Interpreter

Phidgets | IAT351 | Tangible User Interfaces Hiroshi Ishii (MIT)  Tangible Bits physical form to digital information  Tangible User Interfaces physical objects, surfaces, and spaces that act as tangible embodiments of digital information

Phidgets | IAT351 | Triangles Pieces are connected together to trigger digital events  influence the progress of a non-linear story  organize media elements in order to create their own story space

Phidgets | IAT351 | LumiTouch Two interactive picture frames  User’s touching of a local frame translates to a glow on remote frame  She’s thinking of him  He’s thinking of her

Phidgets | IAT351 | Tangible Video Browser Tokens are used to:  Act as container for videos  Select a video  Navigate within the video

Phidgets | IAT351 | What remains hard? Well…everything according to the paper  While an exciting new area, everyday programmers still face considerable hurdles if they wish to create even simple physical user interfaces. Perhaps the biggest--but we believe easily solved---obstacle is the sheer difficulty of developing and combining physical devices and interfacing them to conventional programming languages.

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

Phidgets | IAT351 | Related Work Tools for working with physical input/output devices iRX Board Digital I/O boards Tini boards

Phidgets | IAT351 | 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

Phidgets | IAT351 | Goals Simple so developers concentrate on overall use, modification, and recombination Easy for average programmer

Phidgets | IAT351 | 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.

Phidgets | IAT351 | phidgets : definition widget  (1931) small mechanical device  (today) ‘windows gadget’ phidget (aka phydget)  ‘physical widget’

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

Phidgets | IAT351 | phidgets : architecture Phidget

Phidgets | IAT351 | phidgets : architecture Device Device manager API Simulation

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

Phidgets | IAT351 | phidgets : java API

Phidgets | IAT351 | phidgets : java API

Phidgets | IAT351 | phidgets : programming (output) Phidget COM Object Application creates Device opens sets

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

Phidgets | IAT351 | 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

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

Phidgets | IAT351 | 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); } }); ik.addErrorListener(new ErrorListener() { public void error(ErrorEvent ee) { System.out.println("error event for " + ee); } }); Basic listeners

Phidgets | IAT351 | 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.addSensorChangeListener(new SensorChangeListener() { public void sensorChanged(SensorChangeEvent se) { System.out.println(se); } }); IK listeners

Phidgets | IAT351 | ik.openAny(); System.out.println("waiting for InterfaceKit attachment..."); ik.waitForAttachment(); System.out.println(ik.getDeviceName()); Thread.sleep(500); ik.getOutputCount() Ik.getSensorCount() ik.getOutputState(i); ik.setOutputState(i, ); Ik.getSensorRawValue(i) Ik.getSensorValue(i) Waits until a device is plugged in

Phidgets | IAT351 |

Phidgets Requirement Connection manager ID Simulation mode

Phidgets | IAT351 | Phidget Manager onAttach() onDetach() Count Item DeviceType isAttached() SerialNumber

Phidgets | IAT351 | Phidget Servo MotorPosition NumMotors onPositionChanged()

Phidgets | IAT351 | 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();

Phidgets | IAT351 | 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);

Phidgets | IAT351 | 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);

Phidgets | IAT351 | Digital Output Boolean values are used to set the output Each output has an index: The two slots at either end are grounds // sets output 2 to “high” ik.setOutputState(2, true);

Phidgets | IAT351 | 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

Phidgets | IAT351 | 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);

Phidgets | IAT351 | Drawbacks Need PC Not mobile Not easy to deploy

Phidgets | IAT351 | 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.

Phidgets | IAT351 | 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 >> Documentationwww.phidgets.com software introduction and tutorials : >> Documentationwww.phidgets.com code examples : >> Download >> Beta >> Examples.zipwww.phidgets.com >> Project / Exampleswww.phidgets.com