Go to Post Just a word of advise dont come running up to someone and say OMG OMG its just remember to introduce yourself first. - Mike Schroeder [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-02-2014, 11:54
Maxchrist Maxchrist is offline
Registered User
FRC #4458 (Infernobotix)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Center Moriches, NY
Posts: 10
Maxchrist is an unknown quantity at this point
Using an Analog Ultrasonic Sensor

Hi, I have been trying to use a maxbotix ultrasonic sensor to get a distance using java. The sensor is on an analog channel so it seems that I cannot use the frc api for the ultrasonic sensor. I have the math worked out, and it prints a distance in inches, however the voltage on the sensor is not changing when I move the sensor, which means it is not sending out signals. How can you start the sensor and make it send out sonar signals? Or if I am not going about this the right way, is there a better way to do this? this is what I have so far:
ultra.txt

Last edited by Maxchrist : 09-02-2014 at 12:13.
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2014, 12:32
Thorn Thorn is offline
Registered User
None #2869 (Regal Eagles)
Team Role: Teacher
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Bethpage
Posts: 10
Thorn is an unknown quantity at this point
Re: Using an Analog Ultrasonic Sensor

We had a similar issue with the Analog sensor. We discovered that our analog breakout board went bad and after we swapped it we could see the voltage values change in response to object detection.

We did a simple test like you did, but we were tossing the output into SmartDashboard.
Where does System.out.println(x) go? Is there an easy way to send console output back to the computer for display or log?
Reply With Quote
  #3   Spotlight this post!  
Unread 09-02-2014, 12:37
Maxchrist Maxchrist is offline
Registered User
FRC #4458 (Infernobotix)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Center Moriches, NY
Posts: 10
Maxchrist is an unknown quantity at this point
Re: Using an Analog Ultrasonic Sensor

yes, you can see System.out.println() in netbeans in the output window if you keep it open alongside the drive station.
Reply With Quote
  #4   Spotlight this post!  
Unread 09-02-2014, 13:11
sailorjoe sailorjoe is offline
Mentor, RoboEagles, FWHS
AKA: Joe Hafner
FRC #4579 (RoboEagles)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Auburn, WA
Posts: 10
sailorjoe is an unknown quantity at this point
Re: Using an Analog Ultrasonic Sensor

I think your code needs a small adjustment. It looks to me like it gets a single range value and keeps printing it over and over in the while loop. Move the range statements inside the while loop. Good luck!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:05.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi