Posts Tagged ‘python’

Latest Book Reviews!

Posted: February 15, 2019 in General, review
Tags: , , ,

I’ve recently received a few books to review (and to share at STEM events and workshops) from NoStarch Press.

No Starch Press books for review

 

Both of these titles draw me back to my youth when I was first getting in all things “computery” and electronic.

I can remember a little LadyBird book Ladybird Learnabout Simple Electronics by Kris Cochrane and dreaming about building all the circuits contained therein.

I don’t think I even got as far as making a single one of them, but I ended up with an Electronics Engineering degree so I suppose it served its purpose.

The second book, Mission Python, reminds of the copy out program books which you used to get for the micro computers of the 80’s (the ZX Spectrum, BBC micro, Commodore etc.).  This is still on my review list, so I hope to have a review for this at a later stage.

Enjoy!

Advertisements

Sometimes it can be simple.

Posted: January 30, 2013 in Guides
Tags: , , , ,

I’ve been writing some GPIO control stuff recently using a few different languages and tonight it was the turn of python.
Now from using different languages I’ve grown accustomed to using the BCM references for the GPIO pins.  However as some of you may know, these differ slightly between Rev1 and Rev2 of the boards so it is important to ensure your code matches and is easily adapted for the board you are using.

Pinout for Rev1 and Rev2 RaspberryPi

Diagram includes BCM GPIO references (GPIO.BCM), common functions, Header GPIO references, and Pin numbers (GPIO.BOARD).

An easy solution is simply to use a define for each and edit the code accordingly.  But for python I’d often heard it suggested to automatically detect the revision of the board, which seems very sensible to me.

(more…)