The MagPi: back in print

TheMagPi_i36_cover
Issue 36 of The MagPi magazine was recently released as a downloadable PDF. What ticks the awesome box though is that from this issue onwards the magazine is again available in print.

I worked on ~25 of the first 30 issues of The MagPi writing articles, proof reading and undertaking layout, and recall the fantastic feeling of seeing the magazine printed (thanks especially to Ian McAlpine). With options to purchase from several online Raspberry Pi sites as well as three Kickstarter bundles (including binder) the obvious missing link was high street distribution. The MagPi has now been under the wing of the Raspberry Pi Foundation for six issues and Issue 36 is the first to be available in the high street.

I'll say that again, with emphasis: in the high street.

It takes an incredible effort to launch a new magazine and arrange for distribution to WH Smith and similar. A HUGE well done to Russell Barnes, magazine editor and the rest of the team.

With the magazine back in print what is it like?

Firstly, the print quality is exceptionally high. The front cover has a joint matt-gloss effect with the title, most of the text and the Minecraft Splat elements in gloss on a light blue background. The cover paper used is also a fairly heavy stock and will survive some bashing (as I discovered when the magazine became an inadvertent fly swat the other day). Internally each page is full-colour and exceptionally clear and easy to read. This feels like a professional magazine in one's hand because, well, it is a professional magazine. Russell and co really know their stuff.

TheMagPi_i36_internal
With an increase in size to 100 pages the spine is thick enough that the magazine can sit on a bookshelf and the identity of each issue be determined from the spine. This does show the one drawback to a magazine of this thickness in that the pages will not lie flat. It's not a big problem, but it does mean that when following code tutorials with the magazine on your desk the pages tend to curve. Firmly (but not forcefully) pressing on the magazine once or twice will open up the pages further without damaging the spine.

TheMagPi_i36_contents
Yes, you did read the above paragraph correctly: 100 pages. This is the largest normal (i.e.: excluding Special Edition 1) issue of the magazine yet. Russell and his team have produced an absolutely fantastic publication with numerous hardware and software tutorials, reviews and features. A quick flip through finds 11 pages of adverts (including three asking people to consider subscribing) which I feel is reasonable for a magazine of this size (and the adverts are all Pi-relevant). Personal favourites in this issue include Extra Lives talking about retro gaming and the book review pages as these cover not only Pi-specific books, but also books of related interest. This issue a column of the book reviews pages is devoted to security and penetration testing which is an incredibly interesting subject.

The tutorials cater for all ability levels with a straightforward LED exercise in Python on page 23 at one end of the spectrum and applying physical forces to Python games to model gravity on pages 58 to 63. This is a very clever bit of code that models the movement of spheres, or celestial bodies (think: planets and asteroids). My favourite quote in the whole issue is found here:

For each planet we have, we want to calculate its effect on every other planet


That's a tough ask! Fortunately the article goes into exquisite detail on both the maths and programming needed to accomplish this.

One downside of print though is that if errors creep in then they are irreversible (unless a new print run is undertaken). Before printing The MagPi Volume 1-3 bundles we went back through every single page to update the content for the B+ (which had not been released when we wrote the earliest issues) and to correct any errors we had subsequently found for just this reason. With The MagPi issue 36, as with every magazine, a few gremlin have made it through the editing process and hence have, in print at least, become irreversible. Take the LED article on page 23 for example. The instructions and diagram show to connect to GPIO4 and GND, but the photo shows GPIO3 and +3V3 being used. Likewise, the code listing stated to use GPIO.BOARD but the pinout diagram for the Pi is numbered for GPIO.BCM. As an introductory article, "Get started with Raspberry Pi", errors like this may confuse the reader.

Despite the occasional gremlin the overall quality of the content is first rate. A lot of effort has clearly been put into the magazine. Whether you find reading easier in print or in an electronic format is a very personal thing, and with The MagPi available in both you can take advantage of both, for example: a print magazine that you can search for text within.

The new look MagPi magazine looks great, feels great and has the superb content we all expect from the publication. Best of all, the print edition is now available for a reduced price to subscribers.

Highly recommended.
Comments

PiConfig arrives

Another Kickstarter I’ve been eagerly awaiting recently is PiConfig. Described as the easiest way to set up networking on the Pi this USB stick of wonders looks just the business for when I need to rapidly reconfigure up to 6 Pis on my stand at Bristol Digimakers. Essentially the problem I face is that at home my Pis mostly use DHCP where-as at Digimakers I set up a LAN requiring them all to be on static IP addresses. It’s a real faff having to eject 3 SD and 3 micro SD cards, find the adaptor, and then one by one edit config.txt on a laptop, while trying to remember which card came from which Pi (note to self: must get out label printer).

Much easier, then, just to load PiConfig on my Mac, select the config setting for each Pi in turn, write to the Pi and hey presto all is done. This saves some time going from DHCP -> static (selecting the profile needed each time) and a whole lot when going from static -> DHCP (one config to rule them all). In both directions it wholly eliminates errors as well in the configuration of any card. Win.

So, the question is: does it work? The answer is yes, albeit with a few errors along the way.

The first thing one has to do is run an installer script on each Pi. For some unknown reason this is not included on the USB stick and instead wget must be used. This is a shame as the stick is 4GB in capacity and over 4GB is available. Hang on, that can’t be right:
piconfig_size
Well, apparently it is. Seeing this makes me wonder about the quality of the USB stick from years of reading “is your SD card genuine?” blog posts. Hence, best to take a backup of the software just to be sure. Weirdly this is where I encountered my first problem: right-clicking on the piconfig folder on the stick and choosing Compress “piconfig” results in an error that one file or the other could not be added to the archive. Hmm, this is now getting concerning. I confirmed the stick isn’t write only by creating a new folder on it temporarily.

Instead I copied the whole piconfig folder to my desktop and archived it to a zip there without problem.

Running the PiConfig application presented the program with pretty obvious fields to be completed. But, here again I found a problem: after entering configuration data for the LAN and clicking on the save profile button I was presented with an error, my profiles all disappeared and I had to quit and reload the program again to see them.

[UPDATED]Fortunately the Developer, Mihaly Krich responded very quickly to a message I sent him detailing this fault and has released an updated version of the PiConfig software that addresses this. With the update installed this bug is fixed. On Mac OS X 10.10 when you download the update and run the program you will be presented with a message telling you that only applications from known developers and the App Store can be run. This is a security feature on Mac OS X. To add PiConfig to the list of applications that can be run:

  1. Open System Preferences (quick shortcut: CMD+Space to open Spotlight, type pref and press enter)
  2. Click Security and Privacy
  3. Unlock the preference page by clicking on the padlock in the bottom left and entering your password
  4. Ensure that under Allow apps downloaded from you have “Mac App Store and identified developers”
  5. You will see that the Preferences already identifies that piconfig.app was the last application to need such permissions - click Open Anyway to add it to the safe application list.

piconfig_mac_preference_security

The software author has chosen to save my configuration data inside the Mac OS X package. This means that when when a patched version is released care must be taken to extract the files from /Volumes/PICONFIG/piconfig/osx/piconfig.app/Contents/Resources before replacing the application, else one’s configuration will be overwritten. On Twitter he noted to me that this was due to requiring sudo permissions in Mac OS X which the application does not have.

This save location prohibits the dual-use of any configuration file in Windows and Mac OS X as Windows computers cannot see inside Mac application packages (Mac apps are stored inside.app directories that masquerade as executable programs). I confirmed this to be a problem by loading the Windows executable on a different laptop and sure enough my previous profiles were nowhere to be seen. Given the profiles are saved to a plain text file, a format readable by both operating systems this should have been made accessible to both Mac OS X and Windows.

The final test though is: does this thing work? I can report that yes it does, and very well indeed. As advertised one of my Raspberry Pis is now on a static IP from DHCP... and now it is back to DHCP again after using PiConfig for a second time. Once over the configuration hurdles you can swap configuration on any Pi reliably in well under a minute.

Ultimately, despite less than ideal software and a USB stick that raises a Mr Spock eyebrow, PiConfig does do what it says on the tin and will be an essential part of my exhibition toolkit from now on. It saves me time and makes event setups that much easier.

4/5 “almost spot-on”
Comments

HDMPI arrives: assembly and first impressions

By chance I was actually in when the postman knocked on my door and gave me a plain brown cardboard box. Inside was HDMIPi in full kit-to-be-assembled form. This caught me surprise as I thought HDMIPi was still at the assembly stage (clearly I need to read my emails more closely). Great stuff: a new kit to play with :)

HDMIPi011

The whole package is pleasingly arranged in the box, with the several layers of case surrounding the screen, which came in bubble wrap to protect it. A nice thought. Anyway, that’s enough of unboxing *yawn*. Let’s play with the thing.

Assembly

There is a great video from raspi.tv along with instructions on the HDMIPi website. The video really is step by step and you really can follow it along. Alex Eames has done a great job of explaining exactly which way around all the case components go. Have a dust cloth and a little rocket blower like the Giottos GTCL2810 Q.Ball Angle-Adjustable Air Blower handy to keep dust off. I managed to get two annoying dust spots on the screen before assembly, but in the scheme of things that’s a “meh” and I probably won’t worry about them.

My only two niggles are:

  1. The two 12mm x 2.5mm screws looked identical to the 12mm x 3mm screws at first. So much so that I’d put them into the edge holes on the case and had to go fish them out again. Mental note: always count your screws before building anything.
  2. The USB - micro USB cable that connects the driver board to the Pi is a tight squeeze. It has a double-U (a bit “W”-like I guess) curve that meant it didn’t want to sit parallel in either socket until I applied a fair bit of “bend-thine-cable” force to the cable itself. Now though seems fine and I guess we’ll see soon if it pops out. IMHO a flat mini noodle-like cable would have been better here and this is something I’ll likely take a look at in the future if this proves an issue. You can see the cable in the photo below.
HDMIPi015

The driver board is held securely next to the Pi and there’s no problem in assembling it all. After assembly there is definitely space for a slimline battery in there.
HDMIPi013

To be honest the driver board is a thing of beauty, it really is. It’s darn compact and given it supports a second HDMI output (unfortunately not dual-monitor) it means you can plug your Pi into the widescreen TV in your lounge without having to dismantle the enclosure. Nice.

First boot

The Pi booted first time and the screen lit up without a hitch. I was slightly surprised to see it claiming full HD 1920x1080 when the advertised specs were for 1280x800. However I think (not confirmed) that the higher resolution is scaled. In either case it certainly looked cramped on screen. I followed the instructions to change this to 1280x800 and the whole package became immediately more usable.

How’s it handle

It’s a fairly solid surround, as you’d expect from Pimoroni. A gripe here is that the driver board is only about half an inch from the case and without too much difficulty things could possibly fall in and short. But that’s a hypothetical risk, not something I’ve had a problem with. Your fingers are unlikely to find themselves inside.

One thing I would love (love I tells ya!) would be a rubber bumper surround for the whole thing. I’m going to suggest this to Alex.

HDMIPi020

The ethernet and USB ports have a cut away at the case which you may need to remove. I made the mistake of plugging in an ethernet cable without removing this plate: try unclipping an RJ45 ethernet connector with anything less than a it-conducts-electricity screwdriver and you’ll see what I mean. This won’t be a problem if you remove the cut edge plate first, or use a dinky WiFi dongle (as I now am).

I’ve been toying with buying a new wireless keyboard and trackpad combo to replace my wireless keyboard and mouse and now seems a good opportunity to do so as the adaptor sits too far out from the board, and is kinked at a nasty angle. Again, fixable with a smaller adaptor or by cutting away the small edge panel. Something to be aware of anyhow.

HDMIPi018

Something has to be said for how the driver board dishes out power to the Raspberry Pi. To give you an idea: without HDMIPi a WiFi dongle plus my wireless keyboard and mouse adaptor has always been too much for the USB ports regardless of power supply I use (Even good quality 2A ones). Either the mouse goes all jittery or the WiFi is up and down like a Yo-Yo necessitating the need of an external powered hub. However, with HDMIPi I’ve found so far that this combination is rock solid: WiFi AND a mouse at the same time! Bonza! Obviously you’re mileage will vary.

A note on GPIO: all the pins on the P1 header are available, sunk slightly (~2mm) into the case. This should protect them if you accidentally put the HDMIPi down on something conductive (and when’s that a good idea?). Would you believe it, your GPIO expansion board of choice may work. I tried PiLite and XLoBorg were fine, but TriBorg catches on the plastic case slightly. If this is an issue you can always use a ribbon cable to solve this. XLoBorg is an interesting one as it gives HDMIPi accelerometer and magnetometer capabilities, which coupled with a wireless, battery powered Pi is very, very interesting. A bit of black masking tape, or Sugru would do the trick nicely to cover up XLoBorg.

HDMIPi016

HDMIPi017

HDMIPi019

(The bump out the bottom left is my oh-so-slightly too large wireless keyboard and mouse adaptor).

There you have it, a first look at HDMIPi. My take: an absolutely top notch way of getting a portable 9” screen fastened to your Pi without sacrificing functionality (GPIO or external HDMI connections).
Comments

Raspberry Pi Projects for Kids

First, a disclaimer: I'm one of the volunteer technical reviewers of the book, albeit I do not know Daniel the author and hence do feel I remain impartial. Having read it cover to cover more than once and having gone through every single example I do feel I'm qualified to comment on the book and recommend it.

The book is split into essentially three projects (one with extensions - see below) with the compulsory Getting Started with the Pi that all Pi books seem to have leading the reader in. However kudos to the author for both introducing the command line in the first chapter (an important topic), and also providing a short troubleshooting section for common my-Pi-doesn't-work problems.

Over to the projects: the first, writing a simplified version of Angry Birds in Scratch, is a great way into programming. What I absolutely love about this project is that it introduces an element of real world physics into the equation of how the character moves around the screen. This isn't just yet-another "my cat moves" project. Oh no. On Page 30/31:

"Adding physics...
First, let's add some gravity".

This is done by using separate x and y "speed" variables. Changing the value of y by a negative amount will effectively act to pull the character a little back to earth. This is a great concept to introduce to kids: that variables can be used to control stuff, and you can simulate real-world physics in a computer. It really sets off those neurons: what else can I model in a computer? Absolute top marks to the author for including this. I was smiling a lot when I read this section while reviewing the book.

Onto the second project, and from here on in we're moving from Scratch to Python. What's more the author introduces a basic electronic circuit in the form of a home-made (Blue Peter style with tape and paperclips) game pad controller. This is an entirely achievable project for kids as it involves no soldering. However it may be an idea to work with young kids on this project as there is a possibility of frying the Pi's GPIO port if the cables are badly connected. Done well it'll work a treat. One especially nice touch in this chapter is that the author shows a section of code in Scratch and then presents the same functionality in Python. This definitely eases the transition from one to the other.

And finally the third project. This introduces user interfaces via a project to interface with Google Maps. It's a more complex (but not unachievably so) project that takes one through creating a GUI (using Python's TKinter), obtaining map data via the Google API (and pre-selecting the map's location, scale and size in pixels) and then adding additional user-interactive (via detecting mouse clicks) functionality to the map. As with the previous projects there are some great touches here-in such as introducing the concept that computer languages generally count from 0 and not 1 (ie: the first item is 0 and the second is 1).

So why 4 and not 5 stars? Well, it's a tricky one: the projects genuinely are interesting, achievable, and people of all ages will learn from them, and the book is a reasonable length for a reasonable price. However one does feel that just one more chapter would have been good. I say this as the extensions to the interactive map project, while great ideas, could have been flushed out into a chapter of their own. This is however a grumble more than a genuine complaint. If I could, I'd have given 4.5 stars.

This is an absolutely great read and I genuinely believe that kids will be able to follow these projects at their own pace and gain from them.
Comments

Raspberry Pi Handbook magazine magazine out now

The postman dropped off something I’ve been waiting to see for a while, the Raspberry Pi Handbook, a Linux Magazine Special (#14). 98 pages of Pi goodness with very few adverts makes for a compelling read. Although the price tag of £7.99 feels a little steep that’s the price of more content and less adverts hence I feel it is justified.
RPi_Handbook_LinuxProMagazine_no14
Inside you’ll find lots of new articles on the Pi covering the OS and software, programming and hardware hacking. There’s a particularly interesting article on hooking up a USB weather station to the Pi and outputting the data recorded via a web server (also hosted on the Pi) that I think I’ll be trying out. There is also a very interesting interview with Eben Upton that is worth a read, noting that this interview is available to read for free online. The magazine comes complete with a DVD containing a number of different operating systems for the Pi which is handy to avoid potentially lengthy downloads in some cases, albeit at the price of the ISO images burned to the disc eventually becoming out of date.

The magazine also includes several articles re-printed from The MagPi and it is good to see The MagPi (even if only in part) making its debut on the shelves of WH Smith.

One thing I especially like about the Handbook is that it rapidly goes from beginner to advanced without feeling the need to trudge through endless “this is what a keyboard is: you press the keys and magic happens” very basic introductions to the Pi. There is a lot of straightforward stuff contained in the magazine but the reader is rapidly taken on to advanced topics including compiling from source. Good to see.

Raspberry Pi Handbook, available from... well pretty much anywhere that sells magazines.
Comments

Nokia 3310 LCD board for Raspberry Pi

I recently ordered a Nokia 3310 LCD shield from Texy. The beauty is it comes pre-assembled with 5 micro switches and the 84x48 LCD so no soldering required. The price was pretty superb too at £14 + £4 postage. I looked up the list price of just the LCD and it is about £10 hence 8 pounds extra for a fully assembled board delivered to my door is a bargain.

I have some interesting plans a-foot for this little board.

To get it up and running I needed to install WiringPi from Gordons Projects to work with Texy’s sample code. Be sure to install WiringPi for Python though else you’ll sit there confused like I did wondering what went wrong ;)

Texy_Nokia3310LCD

Something that is most interesting with the 3310 LCD is that it has no internal font set. Consequently you have to define all characters in hex up-front. Luckily (and VERY thoughtfully) Texy provides sample Python code to introduce the functionality of the board which includes a default fairly small font. Calling:

text(‘Hello world’)

will display the text string on-screen. One of the first things I did was to port a pretty good large font to Python from C, the latter courtesy of Petras Sadulkis. The large font takes up three rows per character meaning I had to get it to loop through each row of the array which takes me into my favourite world of multi-dimensional arrays :) (ask me sometime why I love multidimensional arrays so much...) You can see the board outputting the current time (HH-MM, SS.ms) using this larger font.

Here’s some code to get large text working for you for numbers and a few characters (add this into Texy’s sample code), and I apologise in advance for the gratuitous hex:

def display_largechar(char, character_position, display_on_row, font=LARGEFONT):
  try:
    gotorc(0 + display_on_row, character_position)
    for value in font[char][0]:
      lcd_data(value)
    gotorc(1 + display_on_row, character_position)
    for value in font[char][1]:
      lcd_data(value)
    gotorc(2 + display_on_row, character_position)
    for value in font[char][2]:
      lcd_data(value)
    lcd_data(0) # Space inbetween characters.
  except KeyError:
    pass # Ignore undefined characters.


def largetext(string, display_on_row, font=LARGEFONT):
  character_position = 0
  for char in string:
    display_largechar(char, character_position, display_on_row, font)
    character_position += 2

# Based on http://mbed.org/users/snatch59/code/N3310LCD/
LARGEFONT = {
  '0': [
    [0x00,0x00,0xc0,0xe0,0x70,0x30,0x30,0x30,0x70,0xe0,0xc0,0x00,0x00,0x00,0x00,0x00],
    [0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00],
    [0x00,0x07,0x1f,0x38,0x70,0x60,0x60,0x60,0x70,0x38,0x1f,0x07,0x00,0x00,0x00,0x00],
  ],
  '1': [
    [0x00,0x00,0x00,0xc0,0xc0,0xc0,0xf0,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],
    [0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],
    [0x00,0x00,0x00,0x60,0x60,0x60,0x7f,0x7f,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00]
  ],
  '2': [
    [0x00,0xe0,0x60,0x70,0x30,0x30,0x30,0x30,0x60,0xe0,0x80,0x00,0x00,0x00,0x00,0x00],
    [0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xc0,0xf0,0x3f,0x1f,0x00,0x00,0x00,0x00,0x00],
    [0x00,0x70,0x78,0x7c,0x6e,0x67,0x63,0x61,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00],
  ],
  '3': [
    [0x00,0xe0,0x60,0x70,0x30,0x30,0x30,0x30,0x30,0x60,0xe0,0xc0,0x00,0x00,0x00,0x00],
    [0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x3c,0x7c,0xe7,0xc3,0x00,0x00,0x00,0x00],
    [0x00,0x38,0x30,0x70,0x60,0x60,0x60,0x60,0x70,0x38,0x1f,0x0f,0x00,0x00,0x00,0x00],
  ],
  '4': [
    [0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xc0,0x60,0xf0,0xf0,0x00,0x00,0x00,0x00,0x00],
    [0x00,0xe0,0xf0,0xdc,0xce,0xc7,0xc1,0xc0,0xc0,0xff,0xff,0x00,0x00,0x00,0x00,0x00],
    [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x7f,0x00,0x00,0x00,0x00,0x00],
  ],
  '5': [
    [0x00,0x00,0xf0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,0x00],
    [0x00,0x00,0x1f,0x1f,0x18,0x18,0x18,0x18,0x30,0xf0,0xc0,0x00,0x00,0x00,0x00,0x00],
    [0x00,0x30,0x70,0x60,0x60,0x60,0x60,0x70,0x38,0x1f,0x0f,0x00,0x00,0x00,0x00,0x00],
  ],
  '6': [
    [0x00,0x00,0x80,0xc0,0xe0,0x60,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,0x00],
    [0x00,0xfc,0xff,0x33,0x18,0x18,0x18,0x18,0x18,0x30,0xf0,0xc0,0x00,0x00,0x00,0x00],
    [0x00,0x07,0x1f,0x38,0x70,0x60,0x60,0x60,0x60,0x30,0x1f,0x0f,0x00,0x00,0x00,0x00],
  ],
  '7': [
    [0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xb0,0xf0,0xf0,0x00,0x00,0x00,0x00,0x00],
    [0x00,0x00,0x00,0x00,0xc0,0xf0,0x78,0x1e,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00],
    [0x00,0x60,0x78,0x3e,0x0f,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],
  ],
  '8': [
    [0x00,0x80,0xe0,0x60,0x30,0x30,0x30,0x30,0x30,0x60,0xe0,0xc0,0x00,0x00,0x00,0x00],
    [0x00,0x87,0xe7,0x6c,0x18,0x18,0x30,0x30,0x38,0x6c,0xc7,0x83,0x00,0x00,0x00,0x00],
    [0x00,0x0f,0x3f,0x38,0x70,0x60,0x60,0x60,0x60,0x30,0x1f,0x0f,0x00,0x00,0x00,0x00],
  ],
  '9': [
    [0x00,0x80,0xc0,0x60,0x30,0x30,0x30,0x30,0x70,0xe0,0xc0,0x00,0x00,0x00,0x00,0x00],
    [0x00,0x0f,0x3f,0x30,0x60,0x60,0x60,0x60,0x60,0x30,0xff,0xff,0x00,0x00,0x00,0x00],
    [0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x70,0x38,0x1e,0x0f,0x03,0x00,0x00,0x00,0x00],
  ],
  ':': [
        [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
        [0,00,56,56,56,56,56,56,56,56,56,0,0,0,0,0],
        [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
  ],
  '+': [
        [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
        [0,0,64,64,64,64,64,254,254,64,64,64,64,64,0,0],
        [0,0,0,0,0,0,0,15,15,0,0,0,0,0,0,0]
  ],
  '-': [
        [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
        [0,64,64,64,64,64,64,0,0,0,0,0,0,0,0,0],
        [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
  ],  
}

from datetime import datetime

# clear the screen then display the time HH:MM on one row and SS:ms on another
cls()
now = datetime.now()
largetext(now.strftime("%H:%M"),0)
largetext(now.strftime("%S.%f")[:5],3)

With the large font in place and the time display working I can move on to adding a stop watch, along with some configuration menus for brightness, contrast and a few other parameters. Once this is done the fun begins as I’ll be using it to remotely control my two Nikon cameras using the time and stop watch functionality to control when the Pi triggers the cameras to take a photo.

This is a great board to experiment with. It brings out the hex in all of us;) Luckily there are tools online to help out with generating hex images in case you need them:

http://www.quinapalus.com/hd44780udg.html (online character generator - this is pretty nifty)
http://en.radzio.dxp.pl/bitmap_converter/ (LCD Assistant: windows tool for converting monochromatic bitmaps to hex data arrays)

As you can probably tell I’m very pleased with this shield. If I was being picky I would say, as Texy notes, it “almost” fits within the credit-card form factor of the Pi, with the red board under the LCD just poking out a little. I’m hoping this can be sorted as it means the board won’t fit inside tight-fitting cases designed for the Pi. But apart from that, this shield gets a thumbs up from me.
Comments