As my first project, after 3 weeks of Arduino I decided to assembly one "BugBot", very simple indeed. It's so simple that there's only two 9g servos (these generic w/ their torque going from 1kgcm [13.8oz in] to 3kgcm [41 oz in] and sorry, i'm using Metric, not SI) and one 4-pined HC-SR04 ultrassonic sensor, w/ jumpers going to the board, in this very case, an Rev3 Uno.
Then, I want to make it more portable. I started a simple controller.
Simplifying: The LCD used in the "controller" for displaying the distance (in centimeters) measured by the ultrassonic got it right (first i was getting some eletronic noise coming up from the eletric motor of the servo. I attached an 10nF ceramic capacitor in both contats of the servo and it worked. If it's physically correct, i don't know, besides it just worked fine.) but the LCD won't erase in each change. So, if i measure an 345cm distance and them a 50cm, the display will show 505, because the last digit stays. SO i got to reset the board and start it all over again... That bastard is giving me some headaches!
There's a photo of this error plus the full controller and BugBot. Note that the display shows "Distancia" in the first line, that means distance (kinda obvious
But, still the major problem goes with the 4 pushbuttons I attached to the controlled! Theoretically, I was supposed to work (how many times you guys may have heard this one) and each one call a function, for walking forward, left, right... But no sucess at all.
There's the buttons, for you look up for any misconnecting of the jumpers:
And the code is in PasteBin, as I don't want to flood this wonderful and huge forum http://pastebin.com/W4hBhd0A
As you'll see, the comments are in portuguese and I'm Brazillian. As english is not my first language, I'll be grateful for any correction of my grammar, if needed.
Thanks in advance,