View Single Post
  #7   Spotlight this post!  
Unread 09-04-2010, 01:59
Al3+'s Avatar
Al3+ Al3+ is offline
ARTist
AKA: Anthony
FRC #0840 (Aragon Robotics Team)
Team Role: Programmer
 
Join Date: Oct 2009
Rookie Year: 2008
Location: San Mateo, CA
Posts: 58
Al3+ is a jewel in the roughAl3+ is a jewel in the roughAl3+ is a jewel in the rough
Re: INFRARED SENSORS

InfraredSensor->Get() has no parameters, so nothing needs to go inside the parentheses. I think that was the question.

You want something like
Code:
if (InfraredSensor->Get())
  myRobot->Set(0.0);
This will set myRobot to 0 when the infrared beam is interrupted, assuming Get() returns true when interrupted. If it returns false, you'll have to flip it.
__________________
cout << "Hello, robotics. Goodbye, world." << endl;

"The two-axis accelerometer provided in the kit of parts (shown in the picture below) is a two-axis accelerometer." - WPILib User's Guide
Reply With Quote