Pages: [1]   Go Down
Author Topic: trouble with SRF-05 ultrasonic sensor and LCD issues  (Read 439 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello  every one.  I have an  awesome summo robot~(with IR and whiteline sensors) that  kicked  ass in the  last  summo competition i  participated in. I lost   2 a  guy with  6 motors and i  only had  four. Anyway  I'm not complaining.
Well  now i decided to add buttons an  LCD and  one  ultra sonic sensor.
well the   buttons  work  awesome   but  only  half of my  LCD works..  the  backlight  doesnt  even  come  on  and  it  displays only  half  the   screen. im  using the  exact set up  i got on the  arduino site  but  just   changed the  pins....  this is  what  my  code looks like...
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8,9,10,11,12,13);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop()
{
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}

BUT... my  biggest issue is  with the SRF-05.
i  have tested it  using a function generator and an  oscilloscope and it  works  fine... trouble  comes  connecting it  to the  arduino .
i know  i  need  two digital pins. one  for  the  trigger and one for the  echo   but  do  they  have  to be PWM?
pleaase  help  thannxxxx alot
Logged

0
Online Online
Shannon Member
****
Karma: 161
Posts: 10438
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a link to info on the sensor?
Logged

[ I won't respond to messages, use the forum please ]

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24363
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but  do  they  have  to be PWM?
No, neither does (one is an input anyway)
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks guys. I can now  read on  my  serial out. i  can read centimeters. but now when im  making  conditions, do i put in  centimeters

void loop()
{
if (distance = 100)
{
DriveForwad ();
}
else if (distance< 100)
{
Stop();
}

and my LCD is  faulty. it  has  nothing  to  do  with the wiring or my  code.  just tried someone else's LCD and it worked perfect..
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24363
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
if (distance = 100)
BZZZZZZZZT!

Comparison, not assignment.

There is nothing in that sketch to read "distance" anyway.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: [1]   Go Up
Jump to: