Go to Post It wasn't about the ROBOT, or about whether I was male or female, it was about getting to compete in something that was just SO cool. - BandChick [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 10-02-2011, 16:06
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Have problem on getting analog values from lane tracking sensor

the line tracking sensors as found in the kop are not analog, they are simply digital inputs that return true or false. You can customize the threshold on them, but you can't get more detail unfortunately.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #2   Spotlight this post!  
Unread 10-02-2011, 16:35
xinchi.he's Avatar
xinchi.he xinchi.he is offline
Registered User
AKA: Xinchi He
FRC #1209
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Tulsa,OK
Posts: 9
xinchi.he is an unknown quantity at this point
Send a message via MSN to xinchi.he
Re: Have problem on getting analog values from lane tracking sensor

Quote:
Originally Posted by byteit101 View Post
the line tracking sensors as found in the kop are not analog, they are simply digital inputs that return true or false. You can customize the threshold on them, but you can't get more detail unfortunately.
Thanks a lot! But we are not using the digital sensor that provided by FIRST, instead we use our analog sensor which should plug to the analog side card. Is there a method that in java that could access to the analog value it returns??

Thanks!!!!
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2011, 06:03
michael714's Avatar
michael714 michael714 is offline
Registered User
FRC #3863 (Pantherbotics)
Team Role: Teacher
 
Join Date: Apr 2006
Rookie Year: 2007
Location: Newbury Park, CA
Posts: 46
michael714 is on a distinguished road
Re: Have problem on getting analog values from lane tracking sensor

If you have an analog sensor, just plug it into the one of the analog ports on the analog breakout. If your sensor provides an analog value, you could just use GetAnalogIn() (you can find more in the WPI lib reference or the java docs).

Aside from that, you should really be using the provided line sensors. It looks like there will not be a strong contrast in colors between the line and the carpet. However, the line is reflective and the included line sensors work perfectly even from 6 to 12 inches high!
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2011, 09:23
eddie12390's Avatar
eddie12390 eddie12390 is offline
Registered User
AKA: Eddie
FRC #3260 (SHARP)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Pittsburgh
Posts: 285
eddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of light
Re: Have problem on getting analog values from lane tracking sensor

1. Import AnalogChannel

2. Use this is to initialize the sensor:

Code:
AnalogChannel color = new AnalogChannel(channel number);
3. Use this to read the value:

Code:
System.out.println(color.getValue());
That'll probably take a ton of testing to figure out what darkness is what but you'll get there with enough work.
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 10:51.

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