Tag Archive: programming

2016
02/05

Category:
Computing

TAG:




COMMENTS:
Comments Closed

Robot retro-fit

RoboRover

I got a lovely friendly yellow robot (a WowWee RoboRover, as it turns out) as a leaving present from my last school. It’s lovely. But it only goes in one direction: two tractor treads, but only one motor. My 4-year-old loves playing with it, but I can’t help but feel that we could do more…

Over the Christmas break this year, I decided the time had come (particularly in light of the advent of the Raspberry Pi Zero) to upgrade the cute little critter. Tamiya 70097 Today, I finished phase 1 (it sounds better in my head if I pretend I have some kind of structured plan), and proved that the motor unit I’ve picked out will fit in the chassis of the Roborover. It’s a Tamiya 70097 geared twin motor unit, from a range of remote control vehicles (promising start…) and was, itself, rather fun to put together.

I’ve also bought an infra-red receiver, a TSOP38238, to hopefully make use of an old r/c helicopter handset, so that’s this weekend’s challenge; let’s call it phase 2 🙂

Phase 3 will be modifying the chassis to be be able to get the motor unit embedded and running. Ideally, it’ll allow me to use PWM to accurately control the robot speed and direction from the r/c handset stick.

Phase 4 will be re-fitting the body back on top (with modified eye LEDs – I’m hoping to get colour-changing ones in there that will be controlled by the spare stick on the r/c handset.

Phase 5 will be seeing (a) if my 4-year-old is still the same age(!), and (b) whether she likes it!

Wish me luck 🙂

2015
03/09

Category:
Computing

TAG:

COMMENTS:
Comments Closed

Developing for Android on Android

Just a quick post to mention that I’ve been experimenting with developing an Android app. I actually felt I’d come up with a semi-decent idea (for once) and determined that this time I really was going to actually build an app myself. But, as ever, there’s a reasonably steep learning curve for getting into app development (mostly a question of time, not my most abundant commodity) and so I cast around for ways of developing on the device itself… and, ladies and gentlemen, I found a couple of options.

The one I’m using most is DroidScript (available for free on the Play Store). For me, it’s perfect – you write in JavaScript, which I know pretty well, and it takes care of getting the thing going.

I should also give a mention to AIDE, which feels to be a more comprehensive, in-depth approach to getting apps built for Android on Android. I haven’t yet given that a full “crack of the whip” given how easy it is to rattle things up in DroidScript. But, never say never, eh?

2013
05/24

Category:
Computing

TAG:




COMMENTS:
Comments Closed

Programming on an iPad

Just a quick jotting to mark the occasion of my first real programming success in an iPad. Rather chuffed, really, that it all worked out as hoped and seriously impressed with the software involved.

So, then, to details – what have I achieved? Nothing too spectacular in terms of visible results, but I’ve managed to get the Minecraft Pi Python API into the Pythonista app (by means of copy/paste as there seems to be no way to import code from, say, DropBox) and then quickly code a simple class that uses the API, connects to a running instance and posts a chat message.

Like I said, nothing too glamorous, but it proved the idea – now on to some more exciting ideas. I’m going to aim for the tried-and-tested platform that follows the player around, so you can never fall. Then, who knows? The sky is, as ever, the limit 🙂

2013
04/24

Category:
Computing
Teaching

TAG:





COMMENTS:
Comments Closed

After-school MinecraftPi sitrep

So I’ve have a few weeks of running the RaspberryPi after-school programming club and I have to say it’s been an interesting ride. In a way I’m a little disappointed with the lack of programming we’ve managed to achieve. But, on the other hand, the amount of Linux experience they’ve gained (to say nothing of the un-spoken appreciation – there’s been little to no grumbling – they’ve developed for the smoothness of systems like Windows and OSX) has been incredible.

So far, then, we’ve managed to set up and boot a RasPi. We then added configuration to try and work through the school proxy (more on that, later) and then managed to grab MinecraftPi (the “hook” I’m using to get them thinking about coding). This last week we finally managed to get a sample program working (this sample, actually, which draws an analogue clock in the sky) against a couple of the pupil’s MCPi instances.

From here, then, I hope to draw out the programming aspects of the club (using Geany to code Python against their own Minecraft instance, initially, although I hope to work up to running mini-competitions, eg building races, in one world) starting from more simple coding challenges like building a cube of a given material, working up to pyramids (well, ziggurats I s’pose, which I’m thinking must be possible with recursive calls).

So, what have I learned?

Well, it’s mostly been about what I’d do differently next time

Like, having a proxy-configured system image and working from there, instead of having to think on the hoof and get them to change configurations as we go. I could still get them to startup, update and install packages, run X and then shutdown… but I could do it from a position of strength, knowing that the proxy side of things will simply work!

Or, about double-checking the amount of background knowledge required, in order to be able to follow instructions I carefully set out, on how to set up the environment to use the proxy.

Finally, there’s a lesson in terms of not testing, testing and then re-testing (just to test that the testing was working) ideas, configuration and systems before blithely assuming that they would “all work okay” when put in front of pupils; no matter how keen and self-motivated they are, they’re only KS3 and don’t have my 13+ years of programming experience to fall back on when it doesn’t quite work first time because they mis-spelt “Aquire” or didn’t match case in a function definition.

So, one final thing about the proxy. We’re in one of the ex-EMBC counties that stuck with the Capita solution, which means we’re now using the WebShield proxy solution (albeit with custom certificates so I can now actually access Twitter across the school network) – this has been a right royal pain to work around, but for those interested, the answer seems to have been to actually put the proxy login in the configuration, as well as the proxy address.

So, for example, environment variables need to be set like http_proxy=http://user:password@webshield.embc.uk.com:80/ or, for apt-get to function, settings like Acquire::http::proxy "http://user:password@webshield.embc.uk.com:80/"; in the apt.conf file.

Anyone needing fuller details on any of this, don’t hesitate to comment/tweet me – I’m happy to answer questions.

2013
03/19

Category:
Computing
Teaching

TAG:



COMMENTS:
Comments Closed

My first after-school club

So I ran my first proper computing after-school club, this afternoon. This is my third year at the school, having transferred up from primary teaching, and I guess it’s fair to say that it’s taken me this long to feel ready and able to take it on and give it the attention I deserves. Nevertheless, it was a busy session, but one that I found rewarding… once I got my breath back!

As a school we had bought some Raspberry Pi computers to use at a poetry exhibition the school had put on at a local gallery (the Atkins Building gallery), to play recordings of the pupils reading their own poems. The clever gent who helped out it together had carefully popped them in a large plastic casing with buttons, wired onto the GPIO port, so that when you pressed one of the buttons the recording was played through the headphones.

Challenge one for us this afternoon, then, was to get into the cases and “liberate” the Pi’s. Running alongside that, I was busy imaging the pupils’s SD cards that they’d brought in (it seemed fair; we supply the Pi’s, they supply the SD cards – which, after all, they can then take home and use if they feel sufficiently inspired to buy one of these fabulous devices).

After that, it was “merely” a question of hooking them all up (we’re based in my normal ICT suite, so that involves connecting to the PC monitors with a HDMI-to-DVI cable, cannibalising the various PC that have USB keyboards and mice, plus swiping their network cables for the duration) and watching them all switch on… And they all worked! Yippee!

We then briefly talked about the concept of the console shell, X-windows, the superuser and access rights before it was time to show them how to shutdown again and put the lab back to normal, ready for tomorrow.

Next time, I’m hoping to get as far as configuring them to go through the school proxy, updating and then downloading and getting MinecraftPi up and running. The ultimate aim is to be teaching Python programming to these dedicated, geeky, few (I have had interest from about 12 pupils, 7 of whom turned up tonight).

Watch this space…

2013
02/14

Category:
Computing

TAG:




COMMENTS:
Comments Closed

Feeding from Twitter into Evernote again

So, after talking with @IanYorston at BETT2013, I was once again determined to see whether I could get my workflow of posting my favourited tweets into EverNote. The problem being Twitter having shut off the part of their API that easily allowed such things to happen.

After only a short time Googling, I discovered this page which talked about using RSS feeds from your Twitter account. It also (if you read it) goes on to mention about Twitter shutting off their support for RSS feeds in favour of JSON by the end of this month.

Further research led to this article which posited the idea of creating a mini-app on the Twitter side to allow easy access to your account feeds and even gave a simple PHP script to access them.

“Aha,” thought I, “that should be easy!” You would have thought after 13 years of commercial development experience that I would have learned not to assume such things…

After much muttering, I do have a solution working, for free. I probably made things a little harder for myself by only working from my iPad, but I’m kind’f deliberately seeing how much I can actually get done without a laptop just by way of an experiment.

So here’s what I learned:

    • not all free hosts support curl, even though they support PHP scripting

    • online documentation is invaluable

    • once a developer, always a developer – even though I’ve never used PHP before (I was a JSP boy) I found I could follow things enough to get by

    In short, I now have a simple Twitter app registered for my web-site which allows the script to connect using OAuth, then GET my most recent favourites using the 1.1 API, converting the returned JSON to RSS so that my IFTTT recipe can trigger and store those ideas in EverNote.

    Any questions, you know where to find me 🙂