Alright, I’ve FINALLY had a chance to put the source code up on GitHub. Feel free to fork it.
It’s been a while since I wrote on this blog as I’ve been busy on other projects… There’s been a lot going on in the background! I’ve been nominated for the BIMA awards for this project, which for me is amazing! One of the things I really wanted to support within this project is allowing other people to contribute to it. So… As of December 25th, I shall be releasing the code onto GitHub for every one to enjoy as a christmas present. I will also be releasing the iOS app on the App store for free if any one wants to download it and have a play and not get too much into the whole Objective-C thing.
It’s been a lovely ride, we’ll see what’s to come for WiDrive in the new year I hope you guys all appreciate this, I’ll keep you updated!
I’ve just got the UI back from my designer buddy Kofi Brenya absolutely awesome guy, been friends and doing business with him for many years. Any way! Here’s the new UI for WiDrive.
- Drag your finger on the right to control acceleration, if you let go it decelerates back to 0, it acts as a dead mans switch
- Double tap to switch to reverse mode
- The iPhone’s battery is represented by the battery indicator on the right
- Same steering controls as before, use the iPhone as a steering wheel
- Of course there’s the sexy push to start button!
- Indicators flash when turning left and right
- If there’s an error, the handbrake warning light comes on
That’s about it really, comments and suggestions would be much appreciated!
Last Thursday I took this project to my uni’s (Bournemouth) sports hall to take it for a spin. I can say that after 6 months of development, money wasting, blood swear and tears it nearly made me shed a tear to see this fully working with no issues whatsoever (apart from the camera static) in the hands of some of Bournemouth’s most dangerous and incapable drivers. Even worse I’d not been in a sports hall for a while and had forgotten about how polished and pristine the floor normally is.
Any way enough talk here’s the video!
If you want to get your hands and try this out, make sure you keep upto date with our Bournemouth University Graduation show taking place at the end of May this year! @gotoandplay2010
I wanna try and get this on the front page of Digg so… DON’T FORGET TO DIGG THIS POST!
I’ve made a few modifications to my Arduino sketch to keep it small… and I’m happy with it! I’ve learnt that the smaller the footprint on a device with limited memory the faster it can process things. So I’ve gone from an Arduino Sketch of roughly 100 lines of code… to something so slim and simple that it almost feels wrong to use it! Below is the graph from the output of the serial socket…
I’m releasing this code… now… I’m feeling a little nervous about releasing it… If you’re going to copy and paste this code, could you please at least leave the credit at the top? I’ve worked hard on this, and I didn’t do it so some twat can steak his claim on my work!
That’s right, no advanced algorithms, no crazy conversions, I’m just taking the first 3 bytes of the buffer from the socket and assigning it to the acceleration, and the last 3 bytes and assigning it to the steering… There are no heavy HTTP protocols to handle the requests, just one socket stream connection from the iPhone to the Arduino/BlackWidow! I can’t believe that the last 4 months of R&D has led to 8 lines of code!
Just to show you what I mean, the sketch started out like this…
Which works fine if you’re not trying to push through 60 requests per second to a device with 2 KB of SRAM and 1 KB of EEPROM. Just to put it into perspective the iPhone 3GS has 256mb’s of RAM…
Update… sorry guys, I’ve taken the code down… for now! I’ll put it back up once I’ve made my mind up about how to distribute it!
I know I’ve been away for a while but this is why…
On the left you can see the old Arduino and on the right you can see the new streamlined Black Widow from Async Labs, which is just a modified Arduino with WiFi built into it. I’ve also decided to go down the sockets route to communicate between the Arduino and the iPhone, all is going well! I’ve started creating the iPhone app, which is looking pretty nifty, when you turn the phone the steering wheel turns too! And it sends commands to the Arduino. I’ve had a few problems where the servo’s jitter from the commands from the iPhone but have found that connecting directly to the Arduino over WiFi in ad-hoc mode seems to have mitigated this.
Using the serial out on the Arduino I was able to see what values were being received from the iPhone, obviously trying to analyse a load of numbers (several thousand of them) is pretty boring, and I have better things to do with my life. So I downloaded Â Plot for the mac, which will turn a load of data into a graph (before you ask, Numbers and Excel can’t process stupid amounts of data quickly to display them in a graph, even on my dual 2.26ghz quad core mac pro). So below are the fruits of my labour, there are still a few anomalies as you can see, but it’s getting there, once the jitter’s all gone I’ll feel a bit more confident and hook up the speed controller!
Just imagine that those curves are from me tilting the phone.
A friend of mine (Tom) wanted to drive the car over the net, thought I’d give it a go as I haven’t even tried it yet. I’ve basically opened up my network so Tom has direct access to the car from a few URL’s, when he clicks on the URL’s I’m just messaging him telling him where which way the car’s going. The video’s below.
Alright, so I’ve been working on the iPhone app today and thought I’d start with something simple, you know, “press button car go forward” kind of thing child’s play… one might think. Well I was wrong! Unfortunately from my testing the WiShield can only handle 1 http request per second, in laymen’s terms think of it as a really juddery movie, you know when you watch a movie on megavideo or something and it’s constantly stopping to buffer because your stupid house mate is taking up all of the bandwidth downloading hardcore porn, think of how frustrating that is for you, and you’re just watching the thing.
Any way! Now I need to find some other way to communicate with the arduino that’s not to processor intensive. Apparently the WiShield supports other TCP/IP protocols such as UDP and Sockets, once I find out what these things mean I’ll get back to you, to be honest I’m quite surprised I got this far in the first place, I haven’t got a clue what I’m actually doing, I guess I’m just leaving it to fate and hoping everything just falls into place, which it normally does!
On a positive note though, I’ve created my first useful ugly iPhone app today, it’s not pretty I’m not gonna lie, but it’s reading the accelerometers on the iPhone, I’ll translate this into degrees so that when I turn the iPhone the wheels turn too and when you tilt the iPhone forward the car goes forward, and when you tilt it backwards… well I think you can see where I’m going here. Luckily my Nissan GTR kit came with some headlights, so I’ll add a lights button on the app too, so you can be all stealth and then BOOM! LED’s come on! And Dan’s been helping me paint the car, so it’s looking pretty sexy right now.
Any way, that’s it for me for today, it’s 3:00 in the morning, and I’m pretty sad to be on here to be honest, I should be in bed or out getting drunk.
Alright… so I went out to Maplin today and thought I’d splash out a bit and get a sexy project box, dremel grinder and some accessories… the result of this… that bad boy car’s completely wire free! Pictures below!
It’s 1:47 in the morning, my eyes hurt and I’ve voluntarily been at it all day messing around with this WiShield… I can tell you that it’s finally paid off! I’ve managed to get the WiShield to give an XML response based on a URL passed to it… Basically creating a REST webservice on the WiShield/Arduino which will control the servo’s on the car over Wi-Fi from… you guessed it ANY application that can open a URL! I’ll post how I did it in the cook book in the morning when I’m awake!