How do I make a tone play as long as a sensor is reading?
atticuspoint6
Posts: 1
in BASIC Stamp
Trying to program an eight key "piano". I would like to make it play a note for as long as the sensor is activated. I think I want the BuzzerDur to be a word variable, but not sure how to make this work.
IF photo>2000 THEN
BuzzerDur????
Any advice would be great!
IF photo>2000 THEN
BuzzerDur????
Any advice would be great!
Comments
It's possible for a Stamp to make a tone for a time, then quickly test a sensor, then go back to making a tone. The amount of time to test the sensor depends on the type of sensor. If the time is short enough, you might not notice the gap in the tone being produced.
-Phil
Looks to still be available here.
PDF here.