Go to Post (This is why Non-Engineering Mentors make the dinner plans for the team...) - KathieK [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
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 19-02-2009, 17:35
Connor's Avatar
Connor Connor is offline
Registered User
FTC #3768 (Crusading Cucumbers)
Team Role: Leadership
 
Join Date: Sep 2008
Rookie Year: 2008
Location: Texas
Posts: 12
Connor is an unknown quantity at this point
Lightbulb [FTC]: Light Senser

My code is trying to use the light senser to follow the white lines during autonomous. I have seen other teams do this and i was wondering if someone could post some code for it.
Thanks
__________________
"Never is just reven spelled backwards."
Reply With Quote
  #2   Spotlight this post!  
Unread 22-02-2009, 20:49
dooey100 dooey100 is offline
Registered User
FTC #3037
 
Join Date: Feb 2009
Location: Fernie
Posts: 47
dooey100 is on a distinguished road
Thumbs up Re: [FTC]: Light Senser

here is some basic code that will drive until your sensor hits the line:

Code:
motor[drive_right] = 100;       //start driving the motors
motor[drive_left] = 100;
while (SensorRaw[lightSensor] < tapeColor);      //keep driving until you run over the tape, tapeColor is a variable determined by the lighting and color of the tape, we used 340.
motor[drive_right] = 0;       //stop
motor[drive_left] = 0;

following the line is a bit tougher, the general idea is to go straight unless the light sensor goes off the line, if it does, turn until it is on the line again. Good luck getting it working, and if you need another hint, just ask!

Last edited by dooey100 : 22-02-2009 at 20:53.
Reply With Quote
  #3   Spotlight this post!  
Unread 23-02-2009, 14:24
gdo's Avatar
gdo gdo is offline
Never too much duct-tape ;)
AKA: Patrick
FTC #0001 (Team Unlimited)
Team Role: Engineer
 
Join Date: Dec 2005
Rookie Year: 2001
Location: MA
Posts: 131
gdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to behold
Send a message via AIM to gdo Send a message via MSN to gdo
Re: [FTC]: Light Senser

On important thing is make sure you declare tapecolor with

int tapecolor = ____;

As for following the line, i would highly recommend two sensors for line following, just so you get a good tracking.
__________________



FTC #1: http://unlimited.syraweb.org

Got any question for me; AIM, MSN or PM me
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crio network light does not light when camera plugged in Bongle Programming 16 16-01-2009 11:00
[FTC]: FTC]: FTC Champ Tournament - Ontario (Scoring Breakdown) Mr. Lim FIRST Tech Challenge 2 03-03-2008 11:54
[FTC]: [FTC]: Ontario Provincial FTC Start/End Times cbhl FIRST Tech Challenge 8 16-12-2007 13:37
Multiple Light Tracking with Distinct Light Boxes in EasyC hal Programming 1 19-02-2007 11:56
camera trouble,cant tell the green-light from regular white light Nimmy Programming 26 14-01-2007 14:53


All times are GMT -5. The time now is 12:28.

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