View Single Post
  #4   Spotlight this post!  
Unread 15-02-2011, 02:05
Stimpy1901 Stimpy1901 is offline
Registered User
AKA: Bobby
FRC #2348 (Cool Geeks)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2008
Location: Honolulu
Posts: 57
Stimpy1901 will become famous soon enough
Re: Photoelectric sensor wiring

Not quite sure about Windriver this year because we are using Java, but it should be similar.

Does Windriver have a LineTrackerProject sample like Java does? If so, it may be good to review that code.

Below is the code using Java, which should be very similar to C++:

Code:

 DigitalInput left; // initializes digital input for line tracking sensors (be sure to include DigitalInput library)

 left = new DigitalInput(1);  //assigns the signal based on the port you use

//in auto or teleop:

 System.out.println(left.get());//in windriver, you would probably use cout or printf, but the left.get() should give you true or false.
//this should print to the console and be sure this is in some loop or you will only get it once (or use iterative template)
__________________
"The person who says it cannot be done should not interrupt the person doing it."
- Chinese Proverb

Last edited by Stimpy1901 : 15-02-2011 at 02:07.