I've been doing some more work on Lobsang. I'll start with the bad news- when I bought the RasPiO Duino board that now sits atop the Pi and started using it, I had an issue. After a while of using it - writing programs and testing them - the ATMega328p stopped working. I'm not entirely sure why. I replaced it with one from an Arduino Uno and ran avrsetup for the gertboard and am now using that chip instead. The other problem is that for some reason the Arduino IDE does not or cannot wipe the flash memory before downloading a new program. As a result, for my programs to run I must manually wipe the flash with avrdude (I have now added a function into Lobsang's library. A call to Lobsang.Duino.erase() will do it for me) before each and every new code download. This worked up until recently (as of a few days ago) but now - possibly unrelated, possibly a progression of my original problem - the ATMega's id is different. The chip itself still works with the last program I downloaded onto it and serial communication is fine, but the Arduino IDE cannot download a program because the id is different. So I need to find a way to use the '-F' command line option with avrdude in the IDE so that the IDE ignores the id problem, or get yet another chip. As a result of the change in id my Python program run at boot - autorun.py - checks the exit value of avrdude and thinks that there is a problem with the Duino board (which is good, because it's right, but annoying because the Duino still works). Here is what it tells me, (with Minecraftia font and using my hand built Oled library, for those interested):
The other bad news is sensational: thin bare copper wires snap if they get moved a lot. Unfortunately this is what happened to the wires at the back of Lobsang's (servo mounted, moving) head, so before I can do any more distance sensing with the ultrasonic I need to re-solder and properly protect the echo pin voltage divider wires. The two orange wires are the victims of snapation:
And now the good news: I noticed the trolley wheel at the rear of Lobsang was not pivoting on smooth surfaces. Due to friction and leverage the previous design did not pivot freely enough. Now I have redesigned the pivot and relocated the power switch, and it works a lot better (Go to YouTube). I will still have some difficulty reversing in the Three Point Turn Challenge, and I'm not currently sure what to do about that. The trolley wheel may be dropped for a different design...
Here are before and after pictures:
And that's it for now!https://www.youtube.com/watch?v=HuJuvV_jp54