![]() |
Vex Light Sensor on FRC Bot
We tried to use a vex sensor onto our FRC robot to be used to count revolutions by counting a series of alternating black and white tape on a motor. However there is something wrong with my code.
Code:
#include "Main.h" |
Re: Vex Light Sensor on FRC Bot
Did you look at the analog output in the online window? Are you using the light sensor or the line following sensor? I believe the line following sensor would work better for the task you are looking for. Both work with FRC as they are just analog sensors.
|
Re: Vex Light Sensor on FRC Bot
I think you would find that a sensor using uses digital inputs and interrupt routines, like the gear-tooth sensor, more reliable.
I am not familiar with the vex light sensor, however we had success in the past with a Banner light sensor (digital output) that was included in the prior year KOP. (2004/5?) |
Re: Vex Light Sensor on FRC Bot
Yes it is the line following sensor and yes I did look at the terminal window however, I feel that the transition between bright to dark can not be accurately be determined with the vex line following sensor. I believe our banner light sensor from years past cannot be located so it won't do me any good as of now.
|
Re: Vex Light Sensor on FRC Bot
Looking at the specs for the Vex line following sensor: http://www.vexlabs.com/docs/inventor...wer-5-1-06.pdf
It uses IR, probably not desirable to use this year, considering all of the potential interference from remote controls and lap counters. Can you describe the motor or mechanism you want to count RPMs? Edit: I also notice that the sensor should be very close to the tape. 1/8" and from the spec sheet: Because the line follower uses an infrared LED to illuminate its target and an infrared sensor to detect the reflected light, it will actually work in low-light conditions or even in the dark! However, this also means that it can easily become saturated — in other words, everything will look white to it, like an over-exposed photograph — in environments where there is a lot of infrared radiation. You’ll find environments like this in competition settings where tungsten lights are used for illumination. To avoid saturating the infrared sensor, consider mounting it underneath the robot or adding a cardboard shield to block ambient radiation. |
Re: Vex Light Sensor on FRC Bot
I apprecitate I just realized today that the sensor uses IR, so I will consider using some sort of border like the cardboard to protect it from other IR frequencies from reaching it. Today I figured out the problem with my code and it seems that I had to nest an if statement to compensate with the transition between a dark to bright color (black to white).
Code:
if ( light >= 1 && light <= 99 ) //interval of white (Bright) |
Re: Vex Light Sensor on FRC Bot
We found that when using a Vex Line Following Sensor on An FRC bot it is much easier to use it as a digital input. Assuming you are using Black and White you will either get a 0 for black and a 1 for white or vice versa.
On another note if the IR sensor is about 3 inches away form our lap counter how much interference will it receive? I think I might just put some cardboard around it on all sides to be safe. |
Re: Vex Light Sensor on FRC Bot
I just tested some Vex Sensors with some remotes and found that if used as a digital input the number will fluctuate rapidly between 1 and 0 when directly exposed. this goes away after about 2 feet or so. When used as an analog input the number still changes but not as rapidly.
Btw I used a universal remote setup for a magnavox, a samsung remote, and a comcast remote |
Re: Vex Light Sensor on FRC Bot
Quote:
In our robot, we use a gear tooth sensor and can count to a fraction of an inch instead of a fraction of a foot. Don |
| All times are GMT -5. The time now is 00:57. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi