From: Ryan R. <rjr...@uc...> - 2008-05-09 18:38:34
|
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. Ryan 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? > > Thanks, > -Scott > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net 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. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > ------------------------------------------------------------------------ > > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > |