View Single Post
  #1   Spotlight this post!  
Unread 20-02-2010, 16:10
LinkSlayer64 LinkSlayer64 is offline
Registered User
FRC #0562
 
Join Date: Jan 2010
Location: Sterling
Posts: 2
LinkSlayer64 is an unknown quantity at this point
Windriver Vex Ultrasonic Sensor Issues

Hello all,

We are trying to get a Vex ultrasonic sensor to work in Windriver and are having some trouble. Either we get 0.00 or some weird numbers which seem like they'd be right, but we get no input after the initial number. We have tried swapping the Input and output cables and have checked out output format and it is %f. Could someone please post their source code
We used the code
Code:
Ultrasonic ultra;
....
ultra(5, 6)
....
{
ultra.SetEnabled(true);
}
Operator 
{
ultra.SetAutomaticMode();
while (IsOperatorControl())
{
lcd->PrintfLine(lcd->kUser_Line3,"sonic: %f",ultra.GetRangeInches());
lcd->UpdateLCD();
}
}
(sometimes auto was excluded and ping was stuck in the loop)
Note, this is not exact, but it did compile right, etc. we just desperately need help, because this is ANNOYING, personally I may just want to switch to something else, but in the meantime, please help, thanks.