As I’ve probably said in a previous blog post, this is part of my coursework for a module at the university run by none other than Mr Rob Miles. Electronics and Interfacing has to be one of the most interesting modules I’ve done so far at uni. It’s a shame that so little people sign up for the module, but I like how its a nice tiny group of people. For all you 1st year Hull University CS students on the straight Computer Science course, I recommend this module entirely. Heads up note for this blog post, prepare for “ALL THE PICTURES”!
Anyway, the coursework specification requires us to program a robot and a controller which communicate with each other through serial ports. The robot is a FEZ Mini Robot and the controller is a FEZ Panda II with a FEZ Touch LCD Screen from GHI Electronics. When a button is pressed on the controller, the data should be sent over the serial port and received by the robot which then decodes the bytes and performs a command depending on the decoded message. The commands that are received by the robot are “FORWARD”, “BACKWARD”, “LEFT”, “RIGHT”, “STOP” or “KILL” and “TEMP”. I think the first 5 should be straight forward to understand what they are doing to the robot. If you aren’t aware of the last, it gets the temperature of a thermometer eblock attached to the robot’s board.
I managed to implement all of the specification for the robot with no trouble at all. So that I didn’t feel like I was ahead, I started implementing my own little parts to the robot which were approved by Rob himself. I used a variable resistor to control the speed of the robot. The component has a dial on it that you can twist and I’ve coded the program to set the values between 0 to 100. If the robot is moving backwards I just record the position of the dial (say 75) and then just make it negative. Simples.
I also implemented an Infrared Receiver which receives RC5 commands from a TV remote control. All of the components are provided by GHI Electronics and the code for all of the components can be found in dark areas of the interwebs, but if anyone would like the component code I will gladly pass them all on to you.
The next part is the controller. We had to make the controller more object oriented as there were more components than just the single class that the robot is programmed in. I created my on Button and Message class for my controller. Each button is metro themed. Yep you heard that right, metro. Did I mention I loved metro? Well I love metro! The buttons are placed in the fashion of a D-Pad. Here’s a picture:
Rob told me that I should experiment with the software for the FEZ Touch and try to get custom fonts working. So I did! And although it doesn’t seem it on this screen, but the font is “Segoe UI”. The message class that I created just places that nice little temperature on the TEMP button.
Well that was all the specification done for the controller. Commands are sent to the robot and the robot received them perfectly. Rob was happy. I was happy. To keep myself from getting bored and not doing anything during the lab sessions since before Easter when I finished this coursework, I decided to implement a web server to the controller. This information can be found in another of my blogs so go check that out!
I won’t be providing any source code for this until after hand in date for the coursework. I don’t want anyone stealing my code and claiming it as their own now do I.
If you want any information about this coursework, or if you would like help with a FEZ project using the Mini Robot or the Panda II, I will gladly help. Just drop me an e-mail: firstname.lastname@example.org
* It would be much appreciated if you would read this article on the London 2012 Olympics: http://bit.ly/IaTK1X