interactive experimental glass

This blog is a documentation of the "Interactive, Electronic and Experimental glass class held at Pilchcuk Glass School in Stanwood WA, from August 15- September 2

Saturday, August 27, 2005

Photocell+Video(MAX) using Serout command - Zen

Here is the working code.

I made sure my PBasic code was working before attempting to connect the Basic Stamp with MAX. The command for connecting these two languages (PBasic and MAX) is SEROUT.
It is put in to my code as a subroutine, at the end of the cycle. THe first place you will see this is under MAIN, as a subroutine Send_Data. Then you will find the actual routine near the end of the code.
I am using Pin 7 (Serout 7). THe speed the data is sent is 16624. The next two numbers are critical, and I remember their meaning as "1" is the gate that has to be opened to send the data, and "value" is the data being sent. I have defined "value" in my declarations, so PBasic is sending my readings (from the photocell) in huge quantities, as defined by Word. (This is all on page 53 of the Basic Stamp manual)

I am grunting every step of this journey - as if you couldn't tell.
enjoy....
' {$STAMP BS2sx}

'REFERENCE POINTS:

'PHOTOCELL1 VAR Word
'Reference:
'page 50 Basic Stamp Manual for definition of defining Variables
'VAR WORD 'Value can be 0 to 65535
'This sets the range of numbers that will impact the relationships


'BREADBOARD NEEDS:
'Power in
'Regulator
'ADC Stamp and the usual wiring (big brain)
'ADC chip (small brain)

'LIGHT DETECTOR NEEDS:
'Photoresistor or Photocell - 'Photo sensor being used is Cadmium Sulfide (CdS)
'Resistor 220 red-red-brown
'Capacitor (these are ceramic things that look like a guber on 2 wires
'Jumper wires (those little wire things that connect from the brain to the power or ground)

'GOAL OF THIS PROGRAM - to read the photoresistor in RCTime
'RCTime is the pin statement variable - Resistance of Capacitance

' WHAT DO I WANT IT ALL TO DO
' Have the LED on all the time,
' Have the LED turn off when the shadow is strong enough on the Photocell
' Have the LED react to the reading from the photocell
' When the Photocell gives a reading in a certain range, it shuts down the LED
' Then the LED is made to come back on

'ORGANIZING FOR BUILDING THE CODE
'Make my declarations
'Define the list of contents for Main (all of the subroutines)
'ledOn to turn the LED on
'Shutdown to turn the LED off (when interupted by the photocell)


'DECLARATIONS
value VAR Word
'I don't need to declare what the LED is

Main:
GOSUB PHOTOCELL1
GOSUB DECIDE
GOSUB DISPLAY
GOSUB SEND_DATA
GOTO main


'SUBROUTINE FOR PHOTOCELL
'This is to activate the Photocell
PHOTOCELL1:
HIGH 8 'Out of pin 8
PAUSE 1 'the cell should be on all the time, receiving light
RCTIME 8, 1, value ' measure RC discharge time
RETURN
'in daylight 1900 is the cutoff point. number range is 1100 - 2400 in day.

'SUBROUTINE FOR LED
'This will turn the LED on, and tell it when it will be turned off.

DECIDE: 'this subroutine is all about the decisions that are being made
'when the photocell value has a reading above >=1900, it shuts off the led
'when the value of the photocell reading is <=1899 then the led comes back on
IF value >= 1100 THEN SHUTDOWN
IF value <= 1099 THEN LEDON
'the number reads bigger, the darker the environment,late at night, 2900+
RETURN

' ------ [ sub routines for DECIDE ] --------------
'instead of putting SHUTDOWN and LEDON as separate subroutines, they are in DECIDE
'this tells me that the DECIDE subroutine is driving the program
SHUTDOWN:
LOW 7
PAUSE 0
RETURN

LEDON:
HIGH 7 'out of pin 7
PAUSE 0 'this will keep it on all of the time
RETURN

DISPLAY: 'this subroutine runs the debug program and displays the values
'DEBUG DEC ? value ' display value

RETURN 'take debug out when stamp is programmed
'MAX doesn't like debug
SEND_DATA
SEROUT 7, 16624, [1,value] 'this identifies the pin on the basic stamp
PAUSE 2 'this just lets it all breath a beat
'SEROUT 7, 16624'the number 16624 is a logirithmic number for defining buckets of data
'if I was using an adcbit - small brain; chip, then i would code this in
'it would look like (adcbits 1)
RETURN
'the way you stop this running is to unplug tip positive
'============================================



Auction night! The flock of jellyfish came in...


Early morning sand casting. Josh pouring glass for Simone's Palette...

Wednesday, August 24, 2005

Day in the Life of artist programmers......tee hee






success!!!

i wired the LED lights up to my bread board and used the basic stamp to program them to light up. the blue LED's i sanded to further diffues the light coming from them, the red ones i just borrowed to see what it looked like with more of the glass biomorphic "rocks" lit up... now i have to sand some more LED's and solder them to wires to allow them to be placed inside the blown glass at a distance from the bread board.

like most things i make, they look better in the dark...





and this photo i took with a flash so you can see the grass they are sitting in. not to mention the trouble it took to get this far!

and after that, let's hope i can write the code to get them to breathe when you approach them...

woo hoo!

~monika

Medusa lives - Sonar to light 13 led's in succession

8.24.05pm

data_to_jit.qt.movie

Stamp for Sonar and 3 Flashing LED's/SARAH




' {$STAMP BS2sx}

'{$PBASIC 2.0}

'{$PORT COM1}

''Devantech SRF04

' -----[ Declarations ]----------------------------------------------------
confac CON 74
wDist VAR WORD
wDistbyte VAR BYTE
INIT CON 0
ECHO CON 1

' -----[ Main Routine ]----------------------------------------------------
Main:
GOSUB sr_sonar
DEBUG DEC wDist,CR
GOSUB led 'related the led to sensor
'GOSUB Display1 'go to subroutine to show the numbers
GOTO Main

sr_sonar:
PULSOUT INIT,11
PULSIN ECHO, 1,wDist
wDist = wDist/confac
wDistbyte = wDist
'SEROUT 5,16624, [wDistbyte]
PAUSE 70

LOOP
' -----[ Subroutines ]-----------------------------------------------------

led:
IF wdist <= 50 THEN led1
IF wdist >= 50 AND wdist <= 300 THEN led2
IF wdist >=300 THEN led3
RETURN


led1:
HIGH 2
HIGH 3
HIGH 4
RETURN

led2:
HIGH 2
HIGH 3
LOW 4
RETURN

led3:
HIGH 2
LOW 3
LOW 4
RETURN

Code - to have an LED go on and off from the shadow on a photocell sensor/ZEN


Here is the code. It works, thanks to the Ladies of The Code.
The point of adjustment, depending on the lighting conditions where these devices are installed, is in the lines IF THEN.
What you see below are the readings for daylight at 5 in the afternoon on a gloriously sunny day at Pilchuck - rare in its' own right.
For night time, I would probably change the readings as this: the activation point will be around 3100 (not 1900). The range above 3100 can go up to 65535, as defined by the var WORD (which is a way of defining values - see page 50 of the BS manual.)


Enjoy it.....
:-)
and flash softly



'========================================================
' {$STAMP BS2sx}

'REFERENCE POINTS:

'PHOTOCELL1 VAR Word
'Reference:
'page 50 Basic Stamp Manual for definition of defining Variables
'VAR WORD 'Value can be 0 to 65535
'This sets the range of numbers that will impact the relationships


'BREADBOARD NEEDS:
'Power in
'Regulator
'ADC Stamp and the usual wiring (big brain)
'ADC chip (small brain)

'LIGHT DETECTOR NEEDS:
'Photoresistor or Photocell - 'Photo sensor being used is Cadmium Sulfide (CdS)
'Resistor 220 red-red-brown
'Capacitor (these are ceramic things that look like a guber on 2 wires
'Jumper wires (those little wire things that connect from the brain to the power or ground)

'GOAL OF THIS PROGRAM - to read the photoresistor in RCTime
'RCTime is the pin statement variable - Resistance of Capacitance

' WHAT DO I WANT IT ALL TO DO
' Have the LED on all the time,
' Have the LED turn off when the shadow is strong enough on the Photocell
' Have the LED react to the reading from the photocell
' When the Photocell gives a reading in a certain range, it shuts down the LED
' Then the LED is made to come back on

'ORGANIZING FOR BUILDING THE CODE
'Make my declarations
'Define the list of contents for Main (all of the subroutines)
'ledOn to turn the LED on
'Shutdown to turn the LED off (when interupted by the photocell)


'DECLARATIONS
value VAR Word
'I don't need to declare what the LED is

Main:
GOSUB PHOTOCELL1
GOSUB DECIDE
GOSUB DISPLAY
GOTO main


'SUBROUTINE FOR PHOTOCELL
'This is to activate the Photocell
PHOTOCELL1:
HIGH 8 'Out of pin 8
PAUSE 1 'the cell should be on all the time, receiving light
RCTIME 8, 1, value ' measure RC discharge time
RETURN
'in daylight 1900 is the cutoff point. number range is 1100 - 2400 in day.

'SUBROUTINE FOR LED
'This will turn the LED on, and tell it when it will be turned off.

DECIDE: 'this subroutine is all about the decisions that are being made
'when the photocell value has a reading above >=1900, it shuts off the led
'when the value of the photocell reading is <=1899 then the led comes back on
IF value >= 1900 THEN SHUTDOWN
IF value <= 1899 THEN LEDON
RETURN

' ------ [ sub routines for DECIDE ] --------------
'instead of putting SHUTDOWN and LEDON as separate subroutines, they are in DECIDE
'this tells me that the DECIDE subroutine is driving the program
SHUTDOWN:
LOW 7
PAUSE 0
RETURN

LEDON:
HIGH 7 'out of pin 7
PAUSE 0 'this will keep it on all of the time
RETURN

DISPLAY: 'this subroutine runs the debug program and displays the values
DEBUG DEC ? value ' display value
RETURN

'============================================

Tim Jago's Basic stamp with blinking LED

' {$STAMP BS2sx}

'($PBasic 2.5)

Main:

HIGH 7

PAUSE 500

LOW 7

PAUSE 500

GOTO Main





(revert to image of Bread board on Session 5 web site.)

This is the correct code for using Sonar sensor to control led lights. Extrapolate as necessary.

' {$STAMP BS2sx}
' {$PBASIC 2.5}

' Devantech SRF04 Example
' --------------- [ initialize ] ------------------
wDist VAR Word
INIT CON 0
ECHO CON 1

' CONVERSION FACTORS:
'
' The PULSIN command returns the round-trip echo time in 2us units
' which is equivalent to the one-way trip time in 1us units.
'
' distance = (echo time) / (conversion factor)
'
' use 74 for inches (73.746us per 1 in)
' use 29 for centimeters (29.033us per 1 cm)

convfac CON 74 ' use inches

'---------------------------------------------

main:
GOSUB sr_sonar
GOSUB led
GOSUB Display1
GOTO main

' -----------[ sub routines ] ------------------
sr_sonar: ' sonar subroutine
PULSOUT INIT,11 ' 10us init pulse
PULSIN ECHO,1,wDist ' measure echo time
wDist=wDist/convfac ' convert to inches
PAUSE 10
RETURN

'-----------LED conrol sub routines---------------

led: ' main led subroutine
IF wDist >= 200 THEN led1
IF wDist <= 200 AND wDist >= 150 THEN led2
IF wDist <= 149 AND wDist >= 100 THEN led3
IF wDist <= 99 AND wDist >= 50 THEN led4
IF wDist <= 49 AND wDist >= 1 THEN led5
RETURN

led1:
HIGH 3
HIGH 4
LOW 5
LOW 6
LOW 7
LOW 8
LOW 9
LOW 10
LOW 11
LOW 12
RETURN

led2:
HIGH 3
HIGH 4
HIGH 5
HIGH 6
HIGH 7
LOW 8
LOW 9
LOW 10
LOW 11
LOW 12
RETURN

led3:
HIGH 3
HIGH 4
HIGH 5
HIGH 6
HIGH 7
HIGH 8
HIGH 9
LOW 10
LOW 11
LOW 12
RETURN

led4:
HIGH 3
HIGH 4
HIGH 5
HIGH 6
HIGH 7
HIGH 8
HIGH 9
HIGH 10
LOW 11
LOW 12
RETURN

led5:
HIGH 3
HIGH 4
HIGH 5
HIGH 6
HIGH 7
HIGH 8
HIGH 9
HIGH 10
HIGH 11
HIGH 12
RETURN

' ----- [ display / debug space ] -------
Display1: 'opening and running debug window
DEBUG HOME
DEBUG "hex value: ", DEC3 wDist, CR
' PAUSE 100
' DEBUG CLS
RETURN

Class 8-23.... Basic Anologue to Digital with Serout

' -----[ Title ]-----------------------------------------------------------
' Basic Analog and Digital with Serout - Pilchuck August 23 2005'

' -----[ Declarations ]----------------------------------------------------
adcBits1 VAR BYTE

' -----[ Initialization ]--------------------------------------------------
CS1 PIN 0
CLK1 PIN 1
DataOutput1 PIN 2
DEBUG CLS 'Start display.

' -----[ Main Routine ]----------------------------------------------------
DO
GOSUB ADC_Data
GOSUB DISPLAY 'subroutine for the serout data
GOSUB Display1 'subroutine for debug
LOOP

' -----[ Subroutines ]-----------------------------------------------------
ADC_Data:
HIGH CS1
LOW CS1
LOW CLK1
PULSOUT CLK1, 210
SHIFTIN DataOutput1,CLK1,MSBPOST,[adcBits1\8]


IF adcbits1>1 THEN biggie 'biggie is a named variable to carry information to MAX/MSP
adcbits1=2

biggie:'biggie return says when adcbit1=2 return to the Main routine and do the next subroutine DISPLAY.
RETURN

'-----[ Serout_Data ]--------------------------------------------------
DISPLAY:
SEROUT 7, 16624, [1, adcbits1]
PAUSE 2

Display1:
DEBUG HOME
DEBUG "hex value: ", DEC adcBits1, CR

PAUSE 200
DEBUG CLS
RETURN

Tuesday, August 23, 2005

Incandescent lights & BS2sx

From our friend Marko...

"You should check out voltage controlled dimmer kits from VELLEMAN, belgian company. There are a few models which allow a control range which could be tweaked to fit varying control voltages coming from Stamp. In order to get this happening, Stamp could send a PWM style signal (one could work), but if you need more, in order to avoid flicker caused by the fact that it is harder for Stamp to outpot several clean PWM style signals at once.. One option might be to use some type of a DAC style chip or Al Williams PAK-5 coprocessor which can send more steady PWM style control voltages to outside chips etc.. There could naturally be various other options too, but these are the ones I would test first.
There are also some examples in the WWW related to hacking a Home Depot LUTRON dimmer, putting it under Stamp control, can not remember the URL.."

Happy hunting folks!

Nothing to show for at least the last two days of hard, frustrating work!

This is my post - nothing has worked so far during these last couple of days.
I have no photo's to post either - I didn't bring my digital camera cord to connect to the computer - not that it would work anyhow because it is configured for the Mac, not the PC.

I have no sketches to show also - unless I can borrow someone's camera; or put them to the trouble of doing yet another new electronic thing......take the photo's of the desk sketches, the hanging sample, and other odd, asorted notes...

So, right now, I am trying to juggle the following:
1. Getting some code to work that create interactivity through the photocell - when it is in shadow, it shuts down the light emitting device, whether it be a video or projected light or whatever.
2. Resolving the glass work in the sculpture and the projected image (that will be 'paused' when the photocell is activated (using shadow). The image must be organic enough to read back to the viewer, something that is pulsing and alive.....creating illusions of darkness and 'other worldliness'.
3. Thinking far enough ahead for the Wednesday Walk through proposal - we tried projecting on to the oblique panel on the hotshop tonight - it works well with Turi's projector.
4. Resolving the glass work fullstop! THis means more cold shop time, some casting......who knows where this could go.
5. Learning the basics about the MAX application(like how to open it and follow some basic tutorials to even vaguely understand what was shown today!

BUT - I did honor the acquisition mode, and am now the new and very happy owner of a long black cardi, made of angora and rabbit~ Not bad for $10 at Value Village.
ciao
z

Does not work.

The combination of this board configuration and this code has the net result of zilch. No blinkies. No love.



{ Turi took out the bad code - check out the post "This is the correct code for using Sonar sensor to control led lights. Extrapolate as necessary." This is where the working code is posted. }

Simone's ideas


Serout for ADC chip to a MAX serial patch


' -----[ Title ]-----------------------------------------------------------
' Basic Analog and Digital - Pilchuck August 23 2005'

' -----[ Declarations ]----------------------------------------------------
adcBits1 VAR BYTE

' -----[ Initialization ]--------------------------------------------------
CS1 PIN 0
CLK1 PIN 1
DataOutput1 PIN 2
DEBUG CLS 'Start display.

' -----[ Main Routine ]----------------------------------------------------
DO
GOSUB ADC_Data
GOSUB DISPLAY 'subroutine for the serout data
GOSUB Display1 'subroutine for debug
LOOP

' -----[ Subroutines ]-----------------------------------------------------
ADC_Data:
HIGH CS1
LOW CS1
LOW CLK1
PULSOUT CLK1, 210
SHIFTIN DataOutput1,CLK1,MSBPOST,[adcBits1\8]


IF adcbits1>1 THEN biggie 'biggie is a named variable to carry information to MAX/MSP
adcbits1=2

biggie:'biggie return says when adcbit1=2 return to the Main routine and do the next subroutine DISPLAY.
RETURN

'-----[ Serout_Data ]--------------------------------------------------
DISPLAY:
SEROUT 7, 16624, [1, adcbits1]
PAUSE 2

Display1:
DEBUG HOME
DEBUG "hex value: ", DEC adcBits1, CR

PAUSE 200
DEBUG CLS
RETURN

Serout for ADC chip with an Infrared Sensor


' -----[ Title ]-----------------------------------------------------------
' Basic Analog and Digital - Pilchuck August 23 2005'

' -----[ Declarations ]----------------------------------------------------
adcBits1 VAR BYTE

' -----[ Initialization ]--------------------------------------------------
CS1 PIN 0
CLK1 PIN 1
DataOutput1 PIN 2
DEBUG CLS 'Start display.

' -----[ Main Routine ]----------------------------------------------------
DO
GOSUB ADC_Data
GOSUB DISPLAY 'subroutine for the serout data
GOSUB Display1 'subroutine for debug
LOOP

' -----[ Subroutines ]-----------------------------------------------------
ADC_Data:
HIGH CS1
LOW CS1
LOW CLK1
PULSOUT CLK1, 210
SHIFTIN DataOutput1,CLK1,MSBPOST,[adcBits1\8]


IF adcbits1>1 THEN biggie 'biggie is a named variable to carry information to MAX/MSP
adcbits1=2

biggie:'biggie return says when adcbit1=2 return to the Main routine and do the next subroutine DISPLAY.
RETURN

'-----[ Serout_Data ]--------------------------------------------------
DISPLAY:
SEROUT 7, 16624, [1, adcbits1]
PAUSE 2

Display1:
DEBUG HOME
DEBUG "hex value: ", DEC adcBits1, CR

PAUSE 200
DEBUG CLS
RETURN

Document your projects!

Here's a project I prototyped up a while back. It's on my desk. I wanted to make a squishably input device that could sense it's own location. I started with some sketches...




Then I started thinking about the programming and the circuits. I used a program called OmniGraffle to make the diagram below. It's been very helpful when I wanted to go back to the prototype.

More pictures: The Minstrel.

Tim somersaults after Simone caught the hat.


Josh and Tim in the truck.

pilchuck daze

balloons pulling stringers, brains melding with breadboards, and other spectacles.








Monday, August 22, 2005

Josh and his Miniuns







Artists: Glissmann and Höfflin

Electronic Life Forms (E.L.F) - beautiful little creatures made of electronics - another set of artists who really get into the aesthetics of the medium. (I don't recall who was into things in jars and such - but thought of this one.)

http://www.pixelache.ac/2005/helsinki/projects/elf-electronic-life-forms

Artists: More - check the links

Check Ken's links page off of http://www.offdigital.com/ken/ - he's got a great lists of other artists.

Categories:

* Interactivity, robotics and electronics
* Autonomous robotics
* Artificial Life, Artificial intelligence and Generative systems
* Interface, medical systems and tissue
* Rapid Prototyping
* Nano Technology
* Sound and installation
* Biological Systems, ecological issues, genetics and/or robotics
* Kinetics, electronics and light
* Extended reach, telephony and telematics
* Video and installation
* Site, installation and performance environments
* Virtuality and sculpture
* Animation, gaming and virtual environments
* Web art
* Theoretical Writing on electronic art, robotics and telematic Art
* Interdiciplinary museums, festivals, conferences, galleries and community sites

Artists: Diane Thater

Video and Installation Artist. (Sarah - I'm not sure if her work is interactive or not - but she deals with spaces.)


Her work on Artnet

http://www.diacenter.org/exhibs/thater/knots/ - large-scale video installation at the Dia Center.

http://www.the-artists.org/ArtistView.cfm?id=D9900EB0-C762-11D4-A93800D0B7069B40 - her bio and links to more work.

Artists: Fernando Orellana

Toys creatively adapted! Articulated drawing tools!



Article in Wired about his 'Unending Enclosure' - http://www.wired.com/news/technology/0,1282,66101,00.html?tw=wn_story_related - an installation aimed at showing that sometimes, common perceptions are far off base.

From his site - http://www.fernandoorellana.com/work_index_nav.htm Toys creatively adapted - check out 8520 S.W. 27th Pl. v.1. Articulated drawing tools - check out Drawing Machine.

Artists: Zach Lieberman

Zach Lieberman is an artist living and teaching in New York who is “concerned with the themes of kinetic and gestural performance, interactive imaging and sound synthesis” (taken from Messa Di Voce). His work is extremely responsive and expressive. He exemlifies for me how code can be directly used to create joy, engagement, and expressive spaces.


His website is http://www.thesystemis.com/

For anyone intersted in sound and color - Messa di Voce is a must. WATCH THE VIDEOS! Tim - check out Fluid and Insect Nature Show.

Another project with Golan Levin - The Manual Input Sessions

Gesture Machines - Gorgeous interaction experiments - select an experiment (My favorites - Follow the Leader and 3D Scribbler), then draw in the box - now imagine how much fun you can create with code.

RELATED THINGS:

Artists: Stelarc

Australian-based performance artist whose work explores and extends the concept of the body and its relationship with technology through human/machine. (from Google)



Stelarc's work is interactive with the performer (himself), though generally not the audience. His work uses the technology as part of the message and the technology is very present. - Think Cyborgs.

http://www.stelarc.va.com.au/ - official site.

http://www.msstate.edu/Fineart_Online/Gallery/Stelarc/stelarc.html

The Exoskeleton - I find the balance of the body and the machine interesting in this piece.

Code for sonar/infrared sensor to LED



' {$STAMP BS2sx}
' {$PBASIC 2.5}
' -----[ Declarations ]----------------------------------------------------
adcBits VAR BYTE 'declareing variable (ie adcbits is variable)
' -----[ Initialization ]--------------------------------------------------
CS CON 0
CLK CON 1 'declaring pin constants (ie cs is always pin 0)
DataOutput CON 2

' -----[ Main Routine ]----------------------------------------------------
DO
GOSUB ADC_Data ' gets the data
GOSUB led 'related the led to sensor
GOSUB Display1 'go to subroutine to show the numbers

LOOP
' -----[ Subroutines ]-----------------------------------------------------
ADC_Data: 'runs the commands for the ADC
HIGH CS
LOW CS
LOW CLK
PULSOUT CLK, 210
SHIFTIN DataOutput,CLK,MSBPOST,[adcBits\8] 'declare value of adcbits
RETURN 'returns to main routine

led:
IF adcbits >= 024 THEN LOW 8
IF adcbits <= 023 THEN HIGH 8
RETURN

Display1: 'opening and running debug window
DEBUG HOME
DEBUG "hex value: ", DEC3 adcBits, CR
'no person = steady 0, 1meter = between 2-50
RETURN

Sunday, August 21, 2005

climbing, dancing and limping







Not Your Average Pilchuck Class


A different kind of studio experience at Pilchuck. We will get to the glass! after we get LED's to blink.
Some of the assignments we are working on-

Your 1st Interactive Assignment-
1.Choose a sensor: Photocell, potentiometer, FSR, Infrared, Sonar
2. Research the Sensor and make a piece that uses it-sketch ideas, build models, explore.
3.Show to class Monday Morning.
4.Document you piece

2nd Assignment-
Begin to observe the social movements of the people at Pilchuck- Monday make a topographical map.

3rd Assignment-
Prepare a video clip at 320 x 240 Photo-JPEG quality
or
Prepare 3 Jpeg's at 320 x 240 72dpi.