« Return to Thread: Producing a square wave on a gumstix GPIO

Re: Producing a square wave on a gumstix GPIO

by gumstix_user :: Rate this Message:

Reply to Author | View in Thread

If you are doing low frequency stuff you can treat the GPIO lines as files. They are located in /proc/gpio

just open the I/o line you want such as "/proc/gpio/GPIO66" etc and then fprint or fwrite "GPIO out set" or "GPIO out clear" to set the logic level for that bit.

Sometimes you may need to change the tristate state of the line before you use it. This can easily be done with a script.



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
gumstix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gumstix-users

 « Return to Thread: Producing a square wave on a gumstix GPIO