View Single Post
  #1   Spotlight this post!  
Unread 02-02-2013, 16:36
Team 2085 Team 2085 is offline
Registered User
FRC #2085
 
Join Date: Feb 2013
Location: Vacaville
Posts: 6
Team 2085 is an unknown quantity at this point
Question Need help with infrared sensor

Hi, I'm using a 38kHz ir-LED and receiver module. However, I've had some trouble writing code for them. I think I figured out the receiver module and have wrote most of the code for it. I used a simple DigitalInput class and printed the value. It should be 1 if it doesn't receive anything and 0 if it does, right? The main problem I've had is making the LED output 38kHz. I'm trying to use a DigitalOutput class, so I wrote this:

DigitalOutput *irSender;
irSender = new DigitalOutput(2);

irSender->Set(true);

Can someone please tell me what I am doing wrong? I could really use any advice. Thanks
Reply With Quote