View Single Post
  #2   Spotlight this post!  
Unread 18-02-2011, 18:09
Patrickwhite's Avatar
Patrickwhite Patrickwhite is offline
May the North be with you
FRC #0610 (The Coyotes)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Toronto
Posts: 88
Patrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of light
Re: Autonomous Photosensor Programming

In NetBeans, if you create a new FRC Project, and choose from the FRC Sample Projects, you can see one that is a line following project. If you create that project, you can see the example code. It's a bit hard to follow, but it works on the a few basic premises:
1) Using the driver station's digital inputs to choose whether to follow the straight or narrow, and whether to go left or right at the fork
2) Changing the motor's speed based on the time that has elapsed
3) Getting the values from the light sensors and storing it in an integer as a single binary string, i.e. 111 (7) is all sensors on, 000 (0) is all sensors off, 010 (2) is the middle sensor on, etc.
4) Running a switch statement based on the binary string to determine how much to turn.

Take a look through it, and if you have any questions, feel free to come back and ask.
__________________
while(!going.isTough());
tough.exit();

What will we do tonight, Warfa?
The same thing we do every night, Patrick. Sit and wait for Electrical.
Reply With Quote