Following on from the Accessing Twitter with Python post, I’ve made the code in that post more reusable by wrapping it in a Python class and making a distributable library module that I can install on my Raspberry Pi.
The class only serves one method at the moment, that’s to post updates to twitter. I’ll add more as I need them. Continue reading
Figure 1 – BMP085
Another fun little i2c device acquired cheaply via eBay. It reads barometric pressure and temperature. There’s some relatively simple maths to convert the outputs to something readable.
Once again, ADAFruit provide a fantastic guide and library for using the device in their Using the BMP085 with Raspberry Pi. As in previous posts, I could have just used the ADAFruit library out of the box. Whilst I do not feel the need to re-invent the wheel and re-code from scratch, I do like to have an understanding how it works. Continue reading
A quick little post for my future reference really. Wanted to get an i2C Analogue to Digital Converter (ADC) working on a Raspberry Pi. No real application as yet, but sure to be one in the future.
Most of the information to make this work was taken from posts by Grumpy Mike on the Raspberry Pi forums. Got a couple of PCF8591s nice & cheep from eBay. Continue reading
As a building block for future projects I wanted to learn how to post to twitter using Python. There’s quite a bit of help and information out there, some of it out of date as it appears the API has changed particularly in the area of authentication. Not sure when this happened, but some tutorials teach the obsolete username/password method whilst others use the current OAuth method. The python.org’s page on the module was, of course, the most up to date. Continue reading
Figure 1 - Working Breadboard Prototype
In Pelican Crossing – Part 1 software threads were used to provide timing to both the lights and the buzzer at the same time. In Part 2, the I2C MCP23017 is used again but instead of using software to time the operations, the intermittent buzzer is implemented in hardware using a 555 timer. This simplifies the code but makes the hardware more complex. I learned something from both versions.
The python code in Clocks – Part 1: HD44780 16X2 LCD suffers from (at least) one major drawback; if you close the terminal session, the clock dies. This post improves on the by running the clock as a daemon process. That is, one that doesn’t die when the terminal session is closed.
Or by Wikipedia’s definition:
In multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user.
Figure 1- Working Prototype
This is my first attempt at driving a LCD display based on the Hitachi HD44780 LCD controller. The code and circuit wiring is taken from this post on RaspberryPi Spy. I also took some ideas from a similar post on AdaFruit’s Blog.
Figure 1 - In Action
First go with a HC-SR04 Ultrasonice Range Finder with an Arduino Nano. Very simple, worked out of the box. Connected it up, downloaded the New Ping Library for Arduino, used the example program and off it went.
Below I’ll include the schematic & example program. Will need to have a go at some practical uses for this next.
Figure 1 - Prototype
This experiment is the first version of a Pelican Crossing. This version uses discrete components. I won’t be making a veroboard version of this, just prototyping on breadboard. An I2C version may follow.
My Raspberry Pi’s are connected in a headless fashion, over the network with no dedicated screen & keyboard.
I find it more convenient to do my Python programming on my Windows 7 PC using Eclipse with the code base on Network Attached Storage. The same code base is mounted on the Raspberry Pi. It is then possible to tinker with scripts that don’t require the RPi’s hardware within Eclipse or log into the Pi to run the scripts that use the GPIO or to deploy scripts when they are finished.
For me, it’s the best of both worlds. Eclipse is a fantastic feature rich open source Integrated Development Environment.
There are plenty of great installation guides for Python and Eclipse so I won’t re-invent the wheel here just list the compontents and guides to installing them.
Python Programming Language – Official Website
PyDev – Python Plugin for Eclipse