In my previous post about the Pi-Lite I explained how to set it up and how you could display scrolling text in Python. In this post I will explain how to create custom 14×9 pictures and then send them to the Pi-Lite. This is the same technique used to create the Pac Man image to the right.
The Pi-Lite has a frame buffer feature which allows you to send it data which determines the state of each LED. You can set each LED to be on or off and once all your data has been received the Pi-Lite sets the LEDs as instructed.
This command is a string of 126 ones and zeros. The string defines the top left LED and then works down the first column. It then defines the second and so on until all 126 LEDs have been set to either a 1 or 0.
While putting together some future articles I wanted to take some screen shots within LXDE, the Pi’s default graphical interface.
I considered taking them on my PC using a remote desktop connection to the Pi but I thought it might be easier to just take them directly on the Pi as I used it.
To do this I decided to use Scrot which is a command line screen capturing utility.
The installation can be completed on Raspbian using a standard apt-get call :
sudo apt-get install scrot
Until recently I had never played Minecraft but it’s popularity meant it was something I felt I had to try. I installed the free pocket edition on my Nexus 7 to try it out and as a result decided to give it a go on the Pi.
Using the Pi to run Minecraft opens up the possibility to interact with the 3D world using Python. This is something that particularly interested me. You can build structures using the normal interface but on the Pi you’ve got the chance to control that world using scripts to create and edit blocks.
The Pi Edition is similar to earlier versions of the Pocket Edition and only offers “Creative” mode. Therefore it’s not as advanced or fancy as the versions you may be used to playing on other platforms.
So lets get started!
On the 21st September I made my way from Bristol to Cambridge for a Raspberry Jam. It was quite a long journey but was worth it.
I didn’t really plan on buying anything while I was there as I didn’t need anything.
However, that was before I saw the tempting range of Pi items available from the vendors. So here is a quick summary of the various bits and pieces I walked away with.
If you’ve followed the previous Pi-Lite setup article you should have a working Pi-Lite. The example Python scripts are great but I wanted to show a simple example of my own demonstrating the basics of sending scrolling text to the Pi-Lite.
Scrolling text is something that the on-board microcontroller handles for you so it really doesn’t involve much effort to do using a short Python script.
The following script scrolls two messages to demonstrate the technique.
# Define message complete with
# carriage return at the end
message1 = "Hello World!\r"
message2 = "Pi-Lite messages are easy!\r"
# Configure Pi serial port
s = serial.Serial()
s.baudrate = 9600
s.timeout = 0
s.port = "/dev/ttyAMA0"
# Open serial port
except serial.SerialException, e:
# There was an error
sys.stderr.write("could not open port %r: %s\n" % (port, e))
print "Serial port ready"
# Clear display
# Send message 1 to the Pi-Lite
# Short delay to allow the
# 12 character message to finish
# Send message 2 to the Pi-Lite
# Short delay to allow the
# 26 character message to finish
print "Good bye"
I recently purchased a Pi-Lite at the Cambridge Raspberry Pi Jam.This is a 14×9 matrix of red LEDs mounted on a PCB that can be attached to the Pi and controlled via the GPIO header. The 126 LEDs can be turned on individually or used to display scrolling text.
Although there is plenty of help material available from the Openmicros.org site I found it a little bit confusing. Information was spread over a mixture of pages and it was easy to get lost in the more advanced detail while looking for a gentle introduction.
So here is my simplified version. My objective was to configure the SD card, connect my Pi-Lite and get some of the example Python scripts working. Nothing fancy just a quick setup before deciding how to move onto something more complicated.
Yesterday I went to the Raspberry Jam in Cambridge. This was 170 miles from my home but I thought it would be nice to visit the birthplace of the Raspberry Pi and meet some of the Pi enthusiasts who I follow on Twitter and various other virtual environments.
Once I dropped my wife and son in town I arrived at about mid day which left me with a bit of time to setup the various Pi projects I had bought with me to display in the show-n-tell area.
My friend Graham from RaspberryPiSchool.org.uk had already setup the table so all I had to do was unload my box of assorted cables, Pis, plastic cases, bits of cardboard and budget business cards.
The event was organised by Mike Horne (@recantha) and a small group of much appreciated helpers. It was split into into a number of zones including a lecture theatre for talks and presentations, a marketplace with a cool selection of Pi goodies and a set of show-n-tell tables.
The OpenElectrons “PiPan” is a pan and tilt mechanism for the Raspberry Pi Camera Module. I’ve used the Pi camera in a few projects but this is the first bit of commercial Pi camera hardware I’ve had the chance to play with.
The project was successfully funded on Kickstarter on 11th September 2013.
It consists of a kit which when assembled allows you to move your camera in both horizontal and vertical directions. To achieve this is uses two small servos and a control board which can be controlled using Python. It can pan 180 degrees (from left to right) and tilt 110 degrees (top to bottom) although I haven’t been able to test this yet.
I mounted my PiPan on a standard perspex Pi case with the screws supplied with the servos. The control board plugs directly on the Pi’s GPIO header and can be seen inside the case.
The biggest challenge is mounting the unit on a stable platform while ensuring the range of movement isn’t restricted by the camera’s ribbon cable.
I’ve recently got hold of a Perixx Bluetooth keyboard (Model 804) which I plan to use with my tablet for typing and future Raspberry Pi projects. I chose the Perixx 804 as it uses a UK keyboard layout. The black version is a standard PC layout (” on the 2 key) whereas the silver version uses an Apple style layout (@ on the 2 key).
This tutorial will explain how to pair this with your Raspberry Pi. While developing this tutorial I used the black version with the PC-style UK layout as this is the layout I use everyday on my other devices. The process will probably work for any Bluetooth keyboard so feel free to try it out if you’ve already got a device you want to use.
In How To Use A MCP23017 I2C Port Expander With The Raspberry Pi – Part 2 I explained how to use an MCP23017 16-bit port expander to provide additional outputs. In this article I’ll show a basic input example where we read the status of a push switch.
In our example circuit the switch input uses the last bit of the GPA set of pins.