From: Matthew L. <cyb...@we...> - 2010-10-11 17:28:08
|
Thanks! With int main() { FILE *gpio = fopen("/sys/class/gpio/gpio144/value", "w"); while(1) { fputc('1', gpio); fflush(gpio); fputc('0', gpio); fflush(gpio); } fclose(gpio); } I am getting 89kHz now. Fast enough for me! Sebastian Haug wrote: > Hi Matthew, > > On Mon, Oct 11, 2010 at 1:46 AM, Matthew Lai <cyb...@we...> wrote: > >> I wrote a shell script that just writes "1" and "0" to >> /sys/class/gpio/gpio144/value as fast as possible. >> > if you used something like 'cat 1 > /dev/...' this open and closes the > file all the time, which slows it down. > > >> Is there a way to toggle the pin faster? >> > I used a c++ to toggle the pin. Open the file once, write to it e.g. > in a loop, then close it. > > It was definitely faster than 2.5 kHz, unfortunately it was still to > slow for me and I didn't investigate further solutions. > > Sebastian > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > |