Maybe a second thread to do the beeping? Then the main thread just signals. I'd still worry about the buzzer thread getting preempted though. Now that I think about it, the serial port produces a nice clean square wave. By playing with the data and the baud rate you could probably make it work ok. Then all you need to do is write the proper data to the buffer and be on your way. You'd need an amplifier circuit to isolate the UART from the buzzer, but an op-amp or a properly wired transistor should work nicely for that.


Scott Harris wrote:
I need to generate a square wave on a gumstix GPIO pin in order tor drive a piezo buzzer for user feedback.  I'd like to achieve this in python if possible, but I'm not averse to writing some C code to do fiddle with pxaregs. I also need the beeper code not to block my main python loop, since that code is pretty busy.

Does anyone have some suggestions on a minimum hassle path to achieve this?


------------------------------------------------------------------------- This email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.;198757673;13503038;p?

_______________________________________________ gumstix-users mailing list