Thread: Photo Switch!
View Single Post
  #4   Spotlight this post!  
Unread 17-02-2013, 22:49
alexhenning alexhenning is offline
WPILib Developer
FRC #0348
 
Join Date: Apr 2010
Rookie Year: 2003
Location: MA
Posts: 49
alexhenning will become famous soon enough
Re: Photo Switch!

You should replace the line:
if(lightsensor.getAnalogTriggerForRouting() == false) {
with
if(lightsensor.get() == false) {

getAnalogTriggerForRouting() is not what you want to use to get the value of a digital input. The get method returns whether or not it is actually triggered.
Reply With Quote