Saturday, November 8, 2008

Notes Class 7 October 28

92. Phidgets
accelerometer. Open(“localhost”, 5001);


93. Phidgets 2 acceleration
Adds 2 text fields.
Asks for event data in the axis1.text field

axis1.text = evt.Data;
String(evt.Data); will take the data in event1 and changes it into a text string.

Cast event target to whatever kind of thing you have, string, movie clip, etc. wrap it in brackets and then in front tell it what you want it to be.

Passes the data to the text boxes. Easier to read. Get the accelerometer data. It also reads the G forces.


94. interface kit
Brian has a board that reads 8 kinds of data at one time.
8/8/8 = analog inputs/ digital input / digital output /

Light sensor attached to to computer
Make
new PhidgetInterfaceKit();
make newEventListeners

sensor measures how much light is in the room. Where you plug it into is how you talk to it in actionscript.


95.. adds my background sprite
Make a fill and add a black box that is the size of the stage. Format text/ make sensor field. Divide 560 (highest number sensor would read) divide by 1 (or into 1?) to make the measurement map to the 0.0 to 1.0.

You can use it to know when someone lifts something off of the sensor to know when it is picked up. You can find out if something is there or not. Yu’s tea table had light sensors to know when someone picked up a cup.
Put a piece of paper over it, point laser pointer at it, and it will know if someone breaks the beam.

Getting data is easy. how you use the data is the creative area.
Brian has sensors that measure distance, has magnetic sensors that sense if something magnetic is near, temp sensor, vibration sensor, slider potentiometer-like. Boes from 0-1000, motion detector that knows when someone walks by, some also detect presence, distance measuring sensor good till about 6 feet, sonar sensor to know how far away something is to about 10 ft., phidgets also sells ipod sensors to do stuff with or to the ipod. Phidegts need to be able to host through Flash, needs to run on a computer rather than an Arduino board or other board.

Rfid tiny little chips with unique numbers (in the world). Use with a tag reader. Is id tags that can be read remotely.


96. rfiid
Can make fun physical interfaces. TAG and TAGLOSS commands are important in the code example.


97. rfid 2
Not magnetic. Can’t be cleared or wiped. Should work from 4-5 feet. When sensor senses the tag it read the tag and when it loses the tag. Sparkfun is where to get sensors.

Simple - look for var = lastTag
If lastTag is same as last tag place it
If it gets new tag, it replaces the data with the new tag.

If you have an installation with objects. Placing one object near a shelf could play a video. Each object could make different movies run.


98. text output
Belt buckle led
Board has interface board on the back with led screen on front.
textLCD
input1 input2
2 input boxes.
setDisplayString 0 is top row
“” “” 1 is bottom row
You can use it as a trace action



99. servo control
Servos are motors, tiny electric motors. They have a lot of torque. Can support and turn large things, like a cam corder. Needs additional power source. Usb can’t power the servo by itself. Run the servo from a phidgets board. Can input text into it
Will trace the max and minimum position of the servo. In this case it’s changing input1.text into a number.


100. servo control 2
Has my_box scrubber. When mouse rolls over the scrubber it moves the servo.

Math.abs to turn the negative value to positive than add that back into the total to make the whole value in positive and then map that to the scrubber.





Make an application
Main stage class -- holds stuff
Album cover class – knows how to download image, play when rollover and stop when rolloff
Truck class -- moves the covers left and right

No comments: