![]() |
IR programming and wiring difficulties
Hey everyone i have a few questions that i would like to ask.
FIRST of all......i want to make sure that the IR wires should be plugged into the signal pin of the digital input robot controller. I run easy C and when i run the terminal program on it, it tells me that the robot is sensing the ir sensor but all the inputs are always at one, and then when you press one of the ir buttons it changes the three that aren't being used to zero. Is this what is suppose to happen?? i also haven't been able to get the robot to respond with any of my programs can somebody give me an example program to work with to make this right??? thanks for all the help Adam (progammer) |
Re: IR programming and wiring difficulties
Quote:
Is that what you are doing? You can just program around the all 1's business by checking the pins and only capturing the IR sensor command when three of them drop to zero. If you are testing the pins one-by-one be careful to take the first non-1 result you get and save that command. Then don't do anything until they all go to 1 again (or all 0's). Otherwise, you could have the pins start to change back while you are testing them and think several of the cmd signals were sent. There are easier/safer ways to handle this in straight C by plugging into digital input pins 15-18 and capturing all the pins simultaneously via (PORTJ>>4). |
Re: IR programming and wiring difficulties
i got the 0 thing fixed you were right, but i still can't seem to type in anything that will get the robot to work with the IR sensor
|
Re: IR programming and wiring difficulties
1 Attachment(s)
P.S. For Easy C specific questions post in the Easy C Pro sub forum: http://www.chiefdelphi.com/forums/fo...play.php?f=164
Maybe something simple like this, although I warn you I didn't test this on a robot yet. Code:
unsigned char IRcmd1;Add a backup battery since that's all that power things plugged into the pwm outputs. The servo should move from one extreme to the other when the correct button is pushed. You'd have to cycle the power to get it to reset. |
| All times are GMT -5. The time now is 23:17. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi