Go to Post ...isn't that part of the point? For high schoolers to do things they "could not have" by themselves? - AdamHeard [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 20-03-2008, 22:18
Aerex Aerex is offline
Registered User
FRC #1369 (Minotaur)
Team Role: Programmer
 
Join Date: Mar 2008
Rookie Year: 2004
Location: Tampa
Posts: 9
Aerex is an unknown quantity at this point
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)
            {
        light = getAnalogInput(1);
     if (light > 99){
a = 1;
}
                  PrintToScreen ( "a: %d\n" , (int)a ) ;
                  PrintToScreen ( "Light: %d\n" , (int)light ) ;
            }
            if ( light > 99 ) //interval of black (Dark)
            {
 light = getAnalogInput(1);
if (light <= 1 && light <= 99){
                  b = 1 ;
            }
}
            if ( a == 1 || b == 1 )
            {
                  value++ ;
                  a =0 ;
                  b = 0 ;
            }
Now instead of counting RPM, I made so that a certain distance equals one count. Take for example that it takes 10 inches for one round of spins of the motor. If I want to go 20 inches all I would need to do is execute this process twice. I want to know if this idea is pratical to use. I plan on getting the correct measurements at competition.
__________________
Myspace/Facebook + Academics = NoobsHelp.com
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Light Sensor Filter dasmoenator Programming 2 21-11-2007 23:49
Moving bot once targeted on the light bronxbomber92 Programming 10 30-01-2007 12:33
Vex Light Sensor Robots_R_Us Technical Discussion 2 11-08-2006 18:24
Light Sensor Type, Please Help! Alexander McGee Electrical 7 20-11-2004 21:48
How do light sensor(Banner) work? roberthan Programming 9 25-02-2004 14:05


All times are GMT -5. The time now is 20:24.

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