Is there some sort of event trigger on the basic stamp?
lorderico
Posts: 12
Is there a way a can have the basic stamp wait silently for input of some kind. When it receives input, then it runs code that processes what it has received.
Eric
Eric
Comments
DO
LOOP WHILE (IN0 = 0)
This should loop forever until IN0 changes to a 1. You'll need to read the port and mask it off for testing multiple inputs.
--Rich
The recieved data on the serial line can be to·determine what action the·Stamp takes next, for example directed to a sub routine·, perform a calculation with the data·or control some I/O.
Jeff T.
I think polling sounds like a good idea. I control the signal on the computer with a java program, so I will probably have to learn the javax.comm API. Let me know if you have any thoughts on this idea.
Eric
An alternative is to offload the PWM to an external chp, such as the Parallax PWMPAL (#28020). That leaves the Stamp free to listen for the serial input and other supervisory functions. I don't know what function your PWM has. But for some applications the PWM from the BASIC Stamp command is not suitable due to its PFM waveform. The Stamp command is great for generating analog voltages and dimming LEDs but not so great for motor control. The PWMPAL can generate a more traditional PWM, constant frequency, variable duty cycle.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Eric