|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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.
|
|
#2
|
||||
|
||||
|
Re: Have problem on getting analog values from lane tracking sensor
Quote:
Thanks!!!! |
|
#3
|
||||
|
||||
|
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! |
|
#4
|
||||
|
||||
|
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); Code:
System.out.println(color.getValue()); |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|