Proper Cooking with Rob

I've been told that my first cooking recipe, Bananas and Custard, isn't actually a recipe. It's more of a serving suggestion. Huh.

Anyhoo, I'm going to keep going.  This is one of my favourite meals. It's a proper recipe with more than two ingredients. And things to do.  It is what I call "zero effort cooking". We have it quite a lot. Number one wife is very tolerant.

Sausage and Potato Surprise with Beans

Ingredients

  • Two low fat sausages each. You can go for full fat if you like. It's your body.
  • One baking potato each. Not too big. Just handy throwing size.
  • One tin of baked beans. To share. Vary the size of the tin according to the number of diners. Or get more than one tin. That would work too.

Method

  1. Start doing this around an hour and twenty minutes before you actually want to eat: Turn the oven on at 200 degrees or the gas equivalent. Which is definitely not 200. Wash the potatoes and then use a fork to make a few holes in each. Use the pointy ends of the fork, otherwise it is very hard work. Put the potatoes on a shelf in the oven.
  2. Start doing this around half an hour before you actually want to eat: Take the sausages and stick a different fork into those a few times. I'm pretty sure that this is required. Otherwise I think they explode or something. If you are the kind of person who enjoys sticking forks into things you're having a great time by now, and you haven't even eaten anything yet. Put the sausages in a baking tray and put them in the oven with the potatoes. Do not cook the sausages straight from frozen, unless you want to revisit all the meals you've had over the last day or so.
  3. Start doing this around 5 minutes before you actually want to eat: Open the can of beans, drop them in a pan and try to heat them up without boiling them. The true flavour of the baked bean is very delicate and can be somewhat impacted by being burnt onto the bottom of the pan. Number one wife has been known to fry an egg at this point, but I think this spoils the purity of the meal. And besides, the yolks on mine always break.
  4. Start doing this when you want to eat: Serve everything up. Add butter to the potatoes to taste, and I'm a big fan of the Heinz Hot Tomato Ketchup. Note to reader: Heinz are not sponsoring this article. I wish.

Serving Suggestion

  1. I don't know, you could give the meal a frontier air by wearing a bandana and dishing out the beans while holding a knife between your teeth.  Or perhaps wear a cowboy hat and prop a Winchester repeating rifle up against the table.
  2. Oh, and if you are wondering where the surprise is, try shouting "Booo!" as you put the sausages on the plate. Then again, it tastes as good without this.

Ramshacke Rock is back in Groove

Some time back I was bemoaning the way that the "Ramshackle Rock" playlist had vanished from Groove. Well, it's back.

I've now got a mental picture of boffins at Microsoft nervously scanning my blog and then rushing down the corridors to their machines so that they can put right any wrongs that I've noticed. But then again, that's probably not how it works.

But I do like the curated playlists in Groove. Unfortunately, owing to the vagaries of Bayesian logic (which is how I think these things work - you can find a nice description here), I'm not getting exactly the same tracks as last time. But they are all suitable ramshackle.

And, as a major plus, you now have the option to save the playlist for future use. Excellent.

Make a name by making stuff

Been getting some lovely emails over the last few days from people who have been reading my books, learning to program, and trying to make it "big in this business". The question seems to be "How do I get into programming/game development?". Here's one of my replies:

"It turns out that the best way to become a Game Developer is develop games.

Just have a simple (and keep it simple) idea for something and try to make it work. Take a look at the games that are in your books and see if you can modify them to behave differently. Change the images, make them do something different and then go from there.

I'd also advise you to get involved in things like Game Jams, where you can team up with other people and get help. That gets you feedback too. Global Gamejam has just been and gone, but anything like that (there might be some locally) are a good idea. 

If you can't find a gamejam, hold your own. Get some friends together and try to build a game over a weekend. Start with something simple that works and see where you go. And if you start blogging about what you are doing, helping other people and taking part in forums you'll get to know other developers and also start to make a name for yourself.

It will be a lot of hard work and you will need to be very persistent, but I know it can be done because I've seen people do it. "

Wheely Nice Elastic Bands

Some people are seekers of the truth, others are on a quest for the meaning of life. Me, my focus has been a bit more down to earth. I want something that I can use for tyres (or tires) for the wheels on the Hull Pixelbot. And, at last, I may have found them.

I've been using skinny elastic bands for a while, but they tend to fall off the wheel really easily. Experiments with hot glue to hold the bands in place were not on the whole successful, in that I managed to stick pretty much everything to everything - fingers to desk, fingers to each other, fingers to wheel, fingers to elastic band etc etc, without actually achieving the holy grail of sticking elastic band to wheel.

My latest purchase, 50mm x 12mm elastic beauties from ebay, that stalwart Hull Pixelbot supplier, show promise though. If they are as hard to get off as they are to get on the wheel, I might actually be on to something here.

Cooking with Rob

I've started doing more cooking. As you do. Particularly when you are hungry. I'll be posting some of my favourite recipes over the next few weeks, when I can't think of anything else to write.

Today: Bananas and Custard

Ingredients: Two bananas. Tin of custard.

  1. Peel bananas (very important). Don't leave the skins lying on the floor, unless you are after some comedy gold when the next person walks into the kitchen.
  2. Slice bananas into two dishes.
  3. Open tin of custard and share mostly equally in the two dishes.
  4. Give number one wife the dish that you think has the least custard in it.

Tastes even better if the custard was half price.

Important: If you have any kind of custard or banana allergy then you probably shouldn't eat this. Or anything else with the words "custard" or "banana" in its name.

Getting Started at the Hardware Meetup

Too busy to take any snaps at the meetup, here's a picture of some fireworks

I went to the Hardware Meetup with a bunch of things to do. Didn't get to do any of them because there was too much interesting chat. Which was great.

A few new folks turned up too and they were asking what to do to get started. Here's "Rob's Handy List of Hardware Fun Things to Do"

Get a bit of hardware to play with

The clue's in the name. We play with bits of hardware. This doesn't mean that you need to spend a lot of cash though. You can start with just an Arduino and a few leds and switches.  The Arduino is the embedded device that we like to start with. It's easy to program and cheap to buy.

The best place to buy an Arduino is probably eBay. The one you want to gets started is an Arduino Uno (or compatible). Search for "Arduino Uno". You should be able to pick one up for less than a fiver. 

An Arduino on it's own can't do much (although you can flash a light on it) so you might want to take a look at one of the kits that are available. You could start with one that contains a bunch of lights and switches and a few more advanced components. These are also on eBay; I quite like the ones branded Sintron, although others are quite good.

Download the Software

You program your Adruino using a PC, Mac or Linux device. The Arduino software is a free download from here.

Make something work

There are some getting started tutorials here that you might find useful. You can also search YouTube for Arduino videos; these are especially useful if you want to know how to use some of the more exotic devices in the kits.

Once you've got the examples working, have a go at something of your own.

Come to meetups

If you end up making something impressive, bring it along and show us. If you try to make something and get stuck, bring it along and we'll try to help out. We meet up approximately every two weeks at c4di in Hull. You can find the agenda for the meetups (and lots of other things) here.

If it's broken, just throw it away

I'm doing some major upgrades of the HullPixelbot devices at the moment. They are all getting distance sensors, autonomous behaviours and over the air updates.

Most of which works.  Today I found that one of my distance sensors, and one of my Arduino Pro-Mini devices were faulty. They looked fine, but didn't work some of the time.

In the past I might have kept them, in the forlorn hope that perhaps one day I could fix them and save some money. These days I throw suspect parts as far away as I can. The reason is that, in our house at any rate, broken parts have a habit of finding their way back into the system, so that I have to rediscover that they are broken all over again, which is tiresome and time wasting.

In this case I'm down around two quid. That seems a fairly small price to pay for not having to spend half an hour trying to figure out why my code isn't working, when in fact the hardware is broken.

One reason for all this effort is that I'm giving a seminar at Hull University on the 1st of February all about the Hull Pixelbots. It's at 2:00 pm. I'm not sure where yet, but if you want to come along and find out how you can build a Pixelbot all of your own, then it would be great to see you.

I'll also be taking the new Pixelbots into the c4di hardware meetup tomorrow. You can sign up here.

I'm an Idiot

I'm an idiot. Spent half a day chasing a bug that isn't really there. I've been writing the code that lets you download new programs into the HullPixelbot over the network. It worked fine for tiny programs, and then failed for larger ones.

I can hear you thinking "Buffer overrun". Except that I'm not that kind of idiot, and my code is carefully protected against too much data arriving when it shouldn't. And the fault didn't appear at a consistent point in the conversation, which it would if the program was hitting a hard limit somewhere. The failure threshold moved about a bit. Sometimes the program failed with a ten line program, other times it failed with an eight line program.

Any ideas? Took me a little while to figure it out. And of course it was my own stupidity.

It turned out that my over enthusiasm for code instrumentation was my undoing. When you are writing embedded programs you need code instrumentation to stay sane. In simple terms code instrumentation is "putting in print statements to see what is happening". My little program was notifying me each time a data byte arrived so I could convince myself that all was well.

And therein lies the stupidity. It was sending out three bytes of diagnostic information for each incoming byte. Since the send and receive rates are the same, this meant that after a while the program became unable to deal with incoming data because it was taking too long to send out the debug information.

The Arduino will do some buffering of data in and out of the device, but at some point this will fill up, at which point bad things happen. It's not going to happen at a consistent point in the program because the serial timings will vary slightly as other events occur on the processor.

So, I took out the debug code and the program worked perfectly. Strange but true.

And I'm an idiot.

Dirty Lens Blues

I took a good look at some of the photographs that I took yesterday and I noticed that parts of the image are a bit blurred. So I checked the lens surface and I was shocked by the amount of gunk on the glass. I don't remember wiping my nose on the lens (ugh) but It sure looked as if that was what I'd been doing. The lens was filthy and it was only after a bunch of wiping that I managed to rid of the muck.

I'm not a big fan of lens caps, it seems to me that they are a great way to transfer dust from the inside of your pocket to the surface of the lens, but I'm going to have to be a bit more careful in future. Although the pictures haven't turned out too badly.

Proper Blade Pictures

We went up town today and I thought I'd get some pictures of the "blade" once it had been installed. And here it is. To me it looks like it has been Photoshopped into the image. It's such an unlikely thing to find in the middle of a city square that it's rather hard to take in the fact that it is actually real.

I'm quite pleased with this shot from right underneath the blade. Next time I'll have the nerve to lie down on the floor to get an even better viewpoint.

Apollo 11 VR Experience is Awesome

One of the great things about virtual reality is that it can take you places there's no way you'd ever be able to go in real life. For example, the moon.

Apollo 11 VR is an application about the first moon landing. You start off watching President Kennedy's famous speech about choosing to do things like space travel "because they are hard". You're in a very sixties themed briefing room with a flickering projector, a stylish TV and even a lava lamp (you had to be there).

Then, after a tour around your rocket, you're in the command module and blasting off into orbit where you have to dock with the lunar module before heading out into space. Apparently actually landing on the surface of the moon is a bit tricky, but we haven't got that far yet.

Everything is rendered extremely well, your fellow astronauts do look a tiny bit "uncanny valley" but the space scenes are lovely. And there are interactive elements which require more than a little thought and coordination.

It's being sold as a "documentary" and I think that's very fair. It's probably not a thing that you'd go back to time and again (although I think I probably will). The price of seven pounds fifty pence seems reasonable for something like this, I reckon you get an awful lot for your money. And it's a great way to show off the platform.

In fact I think that if you have a VR system, you should get this.

HullPixelbot Code takes shape

Building on the work yesterday, I've now made a little code editor that can be used to control the HullPixelbot motor controller. You can load and save programs and send them via a serial port into an Arduino. The programs are stored in EEPROM inside the device, so that they run when the robot starts up. Next step is to distribute the programs over MQTT using the esp8266. Then I'll be a lot closer to my dream of autonomous robots that I can easily reprogram.

The program above starts a movement and then tests a conditional branch behaviour that fires when the motor stops running. You can use this to write code that starts the robot moving and then responds to events.

The nice thing about the programs so far is that they are very frugal. I've got everything running on a single Arduino Pro-Mini and it seems to work OK at the moment.

Working at c4di

Getting started

The c4di is a great place to work.  I can say that with confidence because this week I've started working there. My home office is great, but there is nothing quite like "going out to work" to get things done. I've been given some space at c4di for a while to just "do interesting things" and I'm going to try and do just that.

I've made some progress with the next version of the HullPixelbot. Up until now the robots have been remote controlled, which is nice, but I really want them to be autonomous, i.e. able to look after themselves.

"That's easy" you say, "Just put a program into the robot.". Well yes, I could do that. The Arduino that I'm using is very easy to write code for. But you can only change the program by plugging the Arduino into the computer again, and I don't want to do that. Worse still, I want to be able to send the same program to many (perhaps even 100) robots at once.

So I've done what any self respecting Computer Scientist would do at this point. I've invented my own programming language, especially for HullPixelbots. It's not a very complicated language, but that's OK. It's a bit hard to understand, but that's OK too, since I'm going to write a little program that will generate robot programs and distribute them.

Today I got HullPixelbot Code working and added the ability to download programs via the serial port. I'd thought it would take a few days to get this working, but I had most of it working by lunchtime. Like I said, a cracking place to work.

I'm going to be setting up some events and whatnot over the next few weeks, but if you happen to be in the c4di please come and say hello. Just walk towards the coloured lights......

On the way out I noticed that they were preparing the tidal barrier.

Potential Dividers for Pixelbots

..a divider with potential

I've been working on the HullPixelbot hardware today. I want to use an HC-SR04 distance sensor so that a robot can detect when it is getting close to something. These devices are not perfect, but they are very cheap (less than a pound from China). Snag is they are 5 volt devices (i.e. they are powered by, and produce signals at, a 5 volt level).

The Arduino Pro-Mini that I'm using to control the motors and sensors is a 3.3 volt device. Directly connecting a distance sensor to it would not end well. It might actually break the Arduino. There are special converter chips thatyou can buy to addressthis, but they are expensive and need to be wired up. Fortunately the only signals you need to worry about are those going into the Arduino, and the only input signal is the echo pulse. So I just have to adjust the level of that signal.

The way that the sensor works is that you give it a signal to say "please measure the distance". The sensor then makes an ultrasonic "squeak" and times how long it takes for the squeak to bounce back. It generates a pulse, called the echo signal that represents this time. The longer the echo pulse, the longer it took for the sound to bounce back, and the further away the target is from the sensor.

The echo signal provided by the distance sensor is either at 0 volts or 5 volts. We want to convert the 5 volt value to 3.3. I've used a potential divider to do this. This uses the principle that the voltages in a circuit are distributed according to the resistances in each element. The higher the resistance of one part of the circuit, the more volts are "dropped" across this part. This probably doesn't seem sensible, but it is how a lot of electronic devices work.

In the old days we used to use lots of low voltage bulbs in our Christmas lights. The mains voltage of 240 volts would be spread over, say 20 bulbs, each designed to work with 12 volts. All the bulbs were connected in a chain, so the voltage dropped across each bulb was 12 volts (a twentieth of 240). Bad news, if one of the bulbs fail the whole chain goes out.

Worse news, if a human being (who has a resistance a lot higher than a 12 volt bulb) puts themselves into the circuit trying to fix this they will find that nearly all the voltage is dropped across them, which is how until recently Christmas was always accompanied by grisly stories of people electrocuted when they were fixing the lights on their tree.

Anyhoo, back to the robot circuit. The total resistance of our two resistors is around 3K. The voltage dropped across the 1K resistor will be around the third of the 5 volt input. These are the volts I don't want. The voltage across the 2K resistor will be around two thirds of 5 volts, which is as near 3.3 volts as makes no difference. And it works, which is nice.

If you think about it, what I've made is a machine that can divide by 3 at close to the speed of light. Any signal going into the potential divider will be divided by 3 on the output because physics. The speed of these two resistors massively outperforms even the most powerful of digital computer, and so-called "analogue" computers like this were much used in the past.

"The Blade" in Hull

I would love to have been at the meeting where someone said "Lets get an enormous wind turbine blade and install it in the middle of Hull". Cue raised eyebrows.

But someone must also have said "Why not?"

And it's awesome. I went up town today to see it being lowered carefully into place. This thing is properly big. At one end they are driving double decker busses underneat it. It's part of the Hull UK City of Culture celebrations and you've got until March this year to come and take a look.

I wonder what they'll replace it with.