Pi Power!


Pi power! The project is coming along nicely. It’s got a #raspberrypi for communication with the outside world, and a custom-made #arduino board for controlling the steering servo and L298-based DC motor driver. I’ve hacked a standard RC receiver to obtain the PPM signal which is decoded using the Input Capture function on pin 14 of the ATMega328.

I’ve had to move away from a lot of the Arduino framework since I wanted to use Timer1 for uS timing of the PPM signal. This meant I couldn’t use the standard Servo library either, so I had to write my own. Turns out it’s pretty easy.

I’m now considering ditching the Arduino framework completely given the only functions I really use are timekeeping and Serial communications. I’m intending to use SPI for communication with the Pi in order to free up the UART for connecting to a GPS module. The Arduino code can only work as a SPI master, and I want to set the uC up as a slave, so that’s something else I’ll have to write for myself anyway. I’ve also just had a bad experience with the String library, which it turns out is a pile of junk and I should have just stuck to char arrays – I’ve now got to rewrite a whole chunk of code. So all-in-all I may as well just ditch Arduino completely and simply use avr-gcc and avrdude directly with a makefile.

Now that I have full manual control of the car, it’s time to start adding sensors and writing the autopilot …