![]() |
INFRARED SENSORS
can any one please assist me on how to program an infrared sensor in autonomous mode, and give a sample code for it in windriver c++?? (i never learned how to program any)
Quote:
|
Re: INFRARED SENSORS
"Programming" an input is just a matter of reading its value and testing it to decide what the program should do. What do you want the program to do?
What output does the sensor provide? If it's the equivalent of a switch, it goes to a digital input. If it's a varying voltage related to the distance from the sensor to the target, it goes to an analog input. You can do anything in the autonomous routine that you would do in teleoperated mode. PWM pins on the Digital Sidecar are outputs only. They can't read sensors. |
Re: INFRARED SENSORS
Quote:
Quote:
|
Re: INFRARED SENSORS
InfraredSensor->Get() will return the state of the input. This method is featured prominently in the documentation for the DigitalInput class, isn't it?
|
Re: INFRARED SENSORS
Quote:
Quote:
|
Re: INFRARED SENSORS
Quote:
I don't really understand the rest of your question, but the documentation should answer anything you need to know. |
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()) |
Re: INFRARED SENSORS
Thanks alot!! :)
|
| All times are GMT -5. The time now is 13:49. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi