Pages: [1]   Go Down
Author Topic: [SOLVED] - BugBot not responding + LCD issue  (Read 1271 times)
0 Members and 1 Guest are viewing this topic.
SC, Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 6
KISS! Keep it simple, Stupid!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Howdy fellows,

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  smiley-razz smiley-razz):



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  smiley-grin smiley-mr-green

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,

Cheers
« Last Edit: March 13, 2012, 12:55:39 pm by tuliobaars » Logged

KISS! Keep it simple, Stupid!

SC, Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 6
KISS! Keep it simple, Stupid!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SOLVED

I finally managed on how to make the pushbutton work. I've connected the wrong button pins and, somehow, it didn't work!

As Cesar Osaka (from Laboratorio de Garagem, a Brazilian DIY/Arduino forum) corrected my circuit, the following images are credited to him.

Button layout (simple):


Code used for correcting the LCD issue:

Code:
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print(distancia);

Simulation using Simulino, Osaka's project for simulating Arduino under Proteus platform:



Thank you all,

Cheers
Logged

KISS! Keep it simple, Stupid!

Pages: [1]   Go Up
Jump to: