Speak-n-Ode

Posted by barnoid Mon, 18 Mar 2013 21:39:03 GMT

This is the latest incarnation of Ode, a bad poetry generator that I first made when I was 13.

See the web version for more information and the code.

This version runs the output of the Ruby code through espeak on a Raspberry Pi.

The music that plays behind the poem is called "Life" and is taken from a four part sequence, "Birth, Life, Dying and Death", composed by Matthew Barton and myself at about the same time as I wrote the original Ode.

TwitBeeb 3

Posted by barnoid Thu, 07 Jun 2012 16:49:00 GMT

TwitBeeb
TwitBeeb on test at Bristol Hackspace, photo by John Honniball.

TwitBeeb is a BBC B microcomputer (vintage 1981) from which you can Tweet.

The Beeb itself was my main computer until 1994, I taught myself to program on it. A few years ago I pulled a rather scuffed up BBC out of a skip at Sussex University and took it home. Inside it had an add-on ROM board with several programs in ROM chips including a serial terminal emulator called Termulator. This allows it to connect to other computers via its serial port and for everything typed on the BBC's keyboard to be sent to the other computer which sends responses back to be displayed on the BBC's screen. It acts as what used to be called a "dumb terminal", just handling the input and output while a more powerful computer does the actual work. This was quite a common way of doing things back when computers were room-sized. Several terminals would connect to a large shared computer, possibly over phone lines using modems.

My first tests with the Beeb terminal involved connecting it to a Linux server using a cable I made from this recipe. It was a bit tricky to find 5 pin domino DIN plugs and note the warning about marking the top because you can plug them in either way up. I ran a text-based web browser called Lynx on the server via the BBC terminal and pointed it at Twitter. Termulator was not very good at handling the full Linux terminal and browser, it tended to crash and you can't use the arrow keys which makes using Lynx awkward. I did manage to send one tweet.

More recently, I got my hands on a Raspberry Pi. While considering what to do with it I remembered my BBC terminal experiments. Given that the Pi is cast from the same mould as the BBC, in terms of their educational intentions, they seem like an obvious pairing. They share a common heritage, in that the Raspberry Pi's ARM processor was designed by some of the same team who worked on the BBC Micro. I also enjoy the fact that in this case the terminal is physically far bigger than the vastly more powerful computer it connects to.

Some spec comparisons:

BBC Micro (Model B)Raspberry Pi (Model B)
Release Date1st December 198129th February 2012
CPU6502 2 MHz (8 bit)ARM1156 700 MHz (32 bit)
RAM32 KB256 MB (262144 KB)
StorageNone in this instance, except the 16KB ROMs containing the OS and terminal software.2 GB SD card

Twitter BBC early experiment.
The first experiment with the BBC B and Twitter via Lynx.

So due to Termulator's problems handling a full text-mode browser and because that would have been too complicated for use on the stand at an event like a Makerfaire I wrote my own specialised kind of Twitter client. The BBC's OS has a set of special bytes that you can send to control things like text colour and cursor position, I used these to make it pretty. It reminded me of the kind of programs that I used to write when I was 11, it was kind of odd to be doing that stuff in Ruby rather than BASIC.

Here is the code, on Github. It searches for a hashtag and displays some results on the screen below the title. At the bottom of the screen it shows a prompt very much like the BASIC one, you type your tweet there and press Return to send it. The hashtag is appended for you. The code stops you typing too many characters.

For TwitBeeb's first public outing at Derby Mini Makerfaire I had the Pi talking to the Internet using a USB Wifi dongle. I set up the network by connecting to the Pi's serial console from my laptop using a USB to serial converter and a Sparkfun level shifter. When the network was working I connected to the Pi with ssh and moved the USB to serial converter to the Pi and connected the serial end to the BBC (minus the level shifter). I then started Termulator on the Beeb, put it in BBC VDU mode and started the twitbeeb script on the Pi. I used the command line to redirect standard in and out for the script to the serial port device, having first set it to run at 4800 baud and several other parameters using stty.

It was quite popular at the Faire, mostly as a spectacle though. People were reluctant to come up with a witty tweet on the spot. It tweets from the @twitbeeb account, you can see people's tweets there. Most confusion came when there was a need to find the "delete" key, and also "@" hidden in plain view on a key of its own.

FSC Hackday Pop-up Lab Timelapse

Posted by barnoid Sat, 19 May 2012 15:15:34 GMT

The temporary Slapton Hackspace working on projects for the first FSC Hackday. See if you can spot the members of Bristol Hackspace.

Raspberry Pi - Project #1: GPIO to Breadboard Breakout

Posted by barnoid Sun, 06 May 2012 17:55:33 GMT

Raspberry Pi - Project #1: GPIO to Breadboard Breakout
This allows me to use an old floppy drive cable to break out the Pi’s GPIO pins to a breadboard. It’s made of a bit of stripboard and pin headers, the outer of which I pushed the pins through so they stick out of the bottom of the board far enough to connect to the breadboard.

See the next photo.

MakeCanon
ModelCanon EOS 5D Mark II
Exposure0.033 sec (1/30)
Aperturef/4.5
Exposure ProgramAperture-priority AE
ISO Speed200
Date and Time (Original)2012:05:06 16:00:55
Exposure Bias+4/3 EV
FlashOff, Did not fire
Focal Length105 mm
QualityFine
Metering ModeEvaluative
Lens TypeCanon EF 24-105mm f/4L IS
Camera Temperature16 C

Raspberry Pi - Project #1: GPIO to Breadboard Breakout

Posted by barnoid Sun, 06 May 2012 17:55:59 GMT

Raspberry Pi - Project #1: GPIO to Breadboard Breakout
Using the breakout adapter and an old floppy drive cable. The cable is too big by eight holes but the excess can just hang off the end.
MakeCanon
ModelCanon EOS 5D Mark II
Exposure0.04 sec (1/25)
Aperturef/5.0
Exposure ProgramAperture-priority AE
ISO Speed200
Date and Time (Original)2012:05:06 13:29:54
Exposure Bias+1 EV
FlashOff, Did not fire
Focal Length80 mm
QualityFine
Metering ModeEvaluative
Lens TypeCanon EF 24-105mm f/4L IS
Camera Temperature16 C

At Last!

Posted by barnoid Fri, 04 May 2012 19:49:18 GMT

At Last!
My Raspberry Pi has arrived.
MakeCanon
ModelCanon EOS 5D Mark II
Exposure0.05 sec (1/20)
Aperturef/4.0
Exposure ProgramAperture-priority AE
ISO Speed400
Date and Time (Original)2012:05:04 19:44:51
Exposure Bias+1 EV
FlashOff, Did not fire
Focal Length105 mm
QualityFine
Metering ModeEvaluative
Lens TypeCanon EF 24-105mm f/4L IS
Camera Temperature23 C

Cress in Progress

Posted by barnoid Tue, 17 Apr 2012 22:43:40 GMT

Cress in Progress
For the next five days this is happening in the cupboard. Cress really moves fast, the seeds started swelling as soon as I put them on the cotton wool.
MakeCanon
ModelCanon EOS 5D Mark II
Exposure0.008 sec (1/125)
Aperturef/4.0
Exposure ProgramAperture-priority AE
ISO Speed200
Date and Time (Original)2012:04:17 21:38:17
Exposure Bias+1 EV
FlashOff, Did not fire
Focal Length24 mm
QualityFine
Metering ModeEvaluative
Lens TypeCanon EF 24-105mm f/4L IS
Camera Temperature22 C

Humidity and Temperature Sensor

Posted by barnoid Sat, 18 Feb 2012 19:13:47 GMT

Humidity and Temperature Sensor
This is my Honeywell HIH-6130 breakout board populated with components. I tested it and it works perfectly. I only made one, this is a composite photo to show the front and back.
MakeCanon
ModelCanon EOS 5D Mark II
Exposure0.005 sec (1/200)
Aperturef/5.0
Exposure ProgramProgram AE
ISO Speed200
Date and Time (Original)2012:02:18 18:36:19
Exposure Bias0 EV
FlashOff, Did not fire
Focal Length105 mm
QualityRAW
Metering ModeEvaluative
Lens TypeCanon EF 24-105mm f/4L IS
Camera Temperature14 C

My First PCB

Posted by barnoid Sat, 18 Feb 2012 19:13:34 GMT

My First PCB
Actually my second, I didn’t realise until I was about to start soldering that the first was mirrored and so couldn’t work with the surface mount chip.

It’s a breakout board for a Honeywell HIH-6130 humidity and temperature sensor. I designed the layout in Eagle, printed it out and transfered some toner onto the copper board by pressing the print against it and heating with an iron. This didn’t transfer enough toner though so I went over it with a pen.

MakeCanon
ModelCanon EOS 5D Mark II
Exposure0.008 sec (1/125)
Aperturef/4.0
Exposure ProgramProgram AE
ISO Speed200
Date and Time (Original)2012:02:18 16:08:47
Exposure Bias0 EV
FlashOff, Did not fire
Focal Length105 mm
QualityRAW
Metering ModeEvaluative
Lens TypeCanon EF 24-105mm f/4L IS
Camera Temperature14 C

Jason's MIDI Milk Bottles 2

Posted by barnoid Sun, 05 Jun 2011 18:53:08 GMT

This video shows to some extent how the bottles are played.

This project by BuildBrighton member Jason Hotchkiss was on display at the Noise Toys workshop.

More information on the project by its creator here: hotchk155.blogspot.com/2011/06/solenoid-percussion-for-bu…