![]() |
IR signals inverted
For some reason the EDU controller is interpretting signals on the first and second digital inputs as 0 and no signal as 1. Am I missing something or is this not correct? I use PrintByte() to print the value of each and the beacons/sensors are functioning perfectly. What could be causing this?
|
Re: IR signals inverted
Quote:
Well the IR sensor (Spec Sheet), will output a logic high (+5v) when it does not see a signal, and a logic low (0v) when it does see a signal. This appears to be what you are seeing. |
Re: IR signals inverted
Thanks, so it would seem that they were working after all.
|
Re: IR signals inverted
Those are the best kinds of problems. :)
|
Re: IR signals inverted
Quote:
-Kevin |
Re: IR signals inverted
Actually I don't think it has anything to do with the sensor output. When I manually connect the pins it reads as 0 and when they are not connected it reads as 0.
|
Re: IR signals inverted
is it possible you redefined the port in your code somewhere to make the pin an output instead of an input?
is it possible you connected something to the pin that you shouldnt have, like 12V, and blew out the input circuit for that pin? I would look up how to connect a simple switch to the port (in the RC reference manual) and try reading the port that way - you cant get any simpler than a switch - if the pin is blown out, and you dont need to use all your input pins, then use another one. |
Re: IR signals inverted
Anything is possible, but not likely. I've triple checked the code to make sure they are inputs. What I said is true for EVERY pin on the EDU controller. I tried the switch method with the same result.
|
Re: IR signals inverted
Any ideas? Am I missing something?
|
Re: IR signals inverted
Quote:
How are you displaying the value? Are you typecasting (int) the char value? e.g., Code:
printf("rc_dig_in1 = %d\n", (int) rc_dig_in1);Code:
|
Re: IR signals inverted
Ok, that is what we are getting. 1 when disconnected and 0 when connected.
|
| All times are GMT -5. The time now is 13:22. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi