Go to advanced search

by gadgetoid
Tue Jul 03, 2012 3:44 pm
Forum: Python
Topic: Python / GPIO speed
Replies: 14
Views: 10134

Re: Python / GPIO speed

Ahh that code!

You can find it here: http://pi.gadgetoid.co.uk/GPIO_OUT_class.py
by gadgetoid
Tue Jul 03, 2012 2:18 pm
Forum: Python
Topic: Python / GPIO speed
Replies: 14
Views: 10134

Re: Python / GPIO speed

texy wrote: Lookin' good! Any chance you could give access to the updated code please?
WiringPython is a Python-wrapped version of Gordon's WiringPi C/C++ library, which you can get from here: https://github.com/Gadgetoid/WiringPython
by gadgetoid
Tue Jul 03, 2012 1:26 pm
Forum: Python
Topic: WiringPython - WiringPi for Python
Replies: 205
Views: 79042

Re: WiringPython - WiringPi for Python

Nice work. I found your other thread, hacked up that script, and posted a benchmark that includes WiringPython. If you don't mind running as root, there's no contest. If you ever get the chance to give WiringPython a try in your real-world use case, I'd love to know how it fares. For raw performance...
by gadgetoid
Tue Jul 03, 2012 1:22 pm
Forum: Python
Topic: Python / GPIO speed
Replies: 14
Views: 10134

Re: Python / GPIO speed

To test WiringPython, which accesses GPIO using shared-memory ( requires root ) I hacked WiringPython into GPIO_OUT_class.py and added an additional test: 10000 writes using standard output method: 6.21796417236 seconds (804.121712734 Hz) 10000 writes using GPIO_OUT class output method: 0.5892589092...
by gadgetoid
Tue Jul 03, 2012 12:37 pm
Forum: Python
Topic: WiringPython - WiringPi for Python
Replies: 205
Views: 79042

Re: WiringPython - WiringPi for Python

Just FYI, I've been tinkering with RPi.GPIO for speed improvements - at least for output - and have managed about a 10x improvement on the standard setup by simply holding the files open for multiple writes, instead of opening/closing them for each write (you need to .flush() of course). That's a c...
by gadgetoid
Tue Jul 03, 2012 11:40 am
Forum: Python
Topic: WiringPython - WiringPi for Python
Replies: 205
Views: 79042

Re: WiringPython - WiringPi for Python

I'd often assumed /sys/class/gpio to be slow, which is why I haven't explored it in any depth. I get stupendous performance out of the shared-memory mode in C, but obviously using it in Ruby incurs a penalty. So, whilst shared memory may be faster, it may not necessarily make a difference if the bot...
by gadgetoid
Tue Jul 03, 2012 8:47 am
Forum: Python
Topic: WiringPython - WiringPi for Python
Replies: 205
Views: 79042

Re: WiringPython - WiringPi for Python

At the moment, no. It's based on Gordon's WiringPi which accesses the GPIO via shared memory or some trickery like that.

I believe a /sys/class/gpio version of the underlying library is coming, but I'm not sure when. When it does, it will be added into WiringPython and WiringPiGem.
by gadgetoid
Tue Jul 03, 2012 8:03 am
Forum: Python
Topic: WiringPython - WiringPi for Python
Replies: 205
Views: 79042

Re: WiringPython - WiringPi for Python

Wasn't aware of RPi.GPIO before. I don't know if it has shiftOut or serial functions? WiringPython does. I'll endeavour to produce examples, but since I'm no Python developer they may not be particularly good. Generally you would: import wiringpi wiringpi.wiringPiSetup IO: wiringpi.pinMode(1,1) // S...
by gadgetoid
Mon Jul 02, 2012 12:32 pm
Forum: Python
Topic: WiringPython - WiringPi for Python
Replies: 205
Views: 79042

WiringPython - WiringPi for Python

First and foremost, a million and one thanks to Gordon for doing all the hard work and producing WiringPi in the first place. You can learn more about it here: https://projects.drogon.net/raspberry-pi/wiringpi/ Not knowing if anyone had done it before, I decided to wrap up WiringPi for Python. Unfor...
by gadgetoid
Sun Jun 03, 2012 10:07 pm
Forum: Other programming languages
Topic: PHP
Replies: 12
Views: 6143

Re: PHP

GordonDrogon's WiringPi should be wrappable for PHP. It has the same drawback: requires root privileges. But when I benched a properly wrapped library against shell-exec the difference in speed was immense. You won't notice this when switching a few LEDs, but if you try to interface with anything mo...
by gadgetoid
Mon May 21, 2012 5:48 pm
Forum: Other programming languages
Topic: Assembly Code
Replies: 60
Views: 24737

Re: Assembly Code

Moving swiftly away from the gentlemans flame-war over the virtues of assembly... does anyone know how one would go about manipulating the GPIO from assembly?

It would be an interesting exercise to write an LED control program entirely in assembly, if it's possible!
by gadgetoid
Sun May 20, 2012 8:31 pm
Forum: Other programming languages
Topic: Assembly Code
Replies: 60
Views: 24737

Re: Assembly Code

Oo, would be nice to drop the % and the $, both have been irritating to say the least. The latter because $n is in my vimrc as a shortcut for blocks of parenthesis... so occasionally it'll explode my code if I type too fast.

What would .code 32 do?
by gadgetoid
Sun May 20, 2012 6:39 pm
Forum: Other programming languages
Topic: Assembly Code
Replies: 60
Views: 24737

Re: Assembly Code

I've been using "as" which is presumably an assembler? I finally got it working, interestingly the solution I eventually came across was the same as that from funnel (thanks, your suggestion would have saved my poor brain if I hadn't found it by sheer determination alone) I humbly submit m...
by gadgetoid
Sun May 20, 2012 5:23 pm
Forum: Other programming languages
Topic: Assembly Code
Replies: 60
Views: 24737

Re: Assembly Code

I've been reading the Programming From The Ground Up book, too, and have had some trouble converting the Assembly syntax into something that works for ARM. I worked most of it out eventually, but got stuck on: movl data_items(,%edi,4), %eax This is used to access data_items, using register %edi with...
by gadgetoid
Thu May 17, 2012 2:32 pm
Forum: Gaming
Topic: Minecraft
Replies: 62
Views: 42394

Re: Minecraft

Alas, the forums need more edit button! A few hundred chunks later and I managed to connect... it spawned me in the middle of the ocean which was puzzling, but I swam to the shore and grabbed a screenie along with my SSH session with the running MC Server. Note the 1-3 seconds between chunk generati...
by gadgetoid
Thu May 17, 2012 2:03 pm
Forum: Gaming
Topic: Minecraft
Replies: 62
Views: 42394

Re: Minecraft

At first I laughed at the sheer absurdity of this thread, having run my own Minecraft servers before. Then I thought... why not, it's worth a try. Then I compiled MC Server and have it running on my Pi. Chunk generation takes so long, though, that my connection is still hanging on "Downloading ...
by gadgetoid
Wed Mar 07, 2012 10:03 pm
Forum: Other projects
Topic: Raspberry Pi console case
Replies: 18
Views: 9257

Re: Raspberry Pi console case

<t>I'd leave the internal SD card in-situ as a boot partition and use a separate, USB-connected SD reader for ROMs and games.<br/> <br/> It strikes me that the PND system and Minimenu front ends built for OpenPandora would be awesome on a Pi console.<br/> <br/> I'm planning on attempting to do somet...

Go to advanced search