Author |
Message |
nglordi Newbie
 Joined: 09/01/2015 Location: United StatesPosts: 4 |
Posted: 01:52pm 09 Jan 2015 |
Copy link to clipboard |
 Print this post |
|
This is my first post on this site.
I am using umite MKII as a robot controller. I would like to use the IR command, but could not get it to work. I checked the IR sensor & remote controller as well as all connections. There seems to be no problem. The IR command does function in the bacKground. However, the command Print Pin(16) gives an error message - Pin 16 is not configured as an input.
My understanding is that the IR command is supposed to configure pin 16 as an input.
Nick |
|
Grogster
 Admin Group
 Joined: 31/12/2012 Location: New ZealandPosts: 9586 |
Posted: 02:30pm 09 Jan 2015 |
Copy link to clipboard |
 Print this post |
|
Hi - welcome to the forums.
The IR command does configure the pin, but you have to use the interrupt to print out the value. Simply printing pin 16 as you are trying to do, will not work - but you have already discovered that!
Have you tried the simple test code on page 16 of the manual?
This demonstrates how the interrupt works to re-direct your program when an IR command is detected. Smoke makes things work. When the smoke gets out, it stops! |
|
nglordi Newbie
 Joined: 09/01/2015 Location: United StatesPosts: 4 |
Posted: 03:44pm 09 Jan 2015 |
Copy link to clipboard |
 Print this post |
|
Thanks for the reply - but I did run the test code on p. 16. There was no response to the remote.
Nick |
|
Grogster
 Admin Group
 Joined: 31/12/2012 Location: New ZealandPosts: 9586 |
Posted: 03:55pm 09 Jan 2015 |
Copy link to clipboard |
 Print this post |
|
Have you tried a different remote? The IR function can read many remote codes, but certainly not all of them. If you are not even getting a response from the demo code on page 16, then I think we have a case of remote incompatibility perhaps. That, or the IR receiver is faulty or not for the correct modulation frequency.
Other members here will chime in with their thoughts, no doubt.
You do have to be using a remote whose modulation protocol is supported, to be able to use the IR function, and if you are using something that is not supported(perhaps with it's own somewhat unique protocol or something), you will get no results.
C'est La. Vie......
Are you able to tell us/link us to the remote and receiver you are using, so myself and others here can check them for compatibility for you? Smoke makes things work. When the smoke gets out, it stops! |
|
WhiteWizzard Guru
 Joined: 05/04/2013 Location: United KingdomPosts: 2932 |
Posted: 11:11pm 09 Jan 2015 |
Copy link to clipboard |
 Print this post |
|
Hi Nick,
As Grogster says, please state which IR receiver part you are using; and also the make/model of the IR transmitter (and maybe a picture too).
The example code to try can be modified slightly to confirm if any 'interrupt' is indeed triggered (without trying to interpret which button is actually pressed). Have the MicroMite connected to a console program while running (i.e. TeraTerm):
IR DevCode, KeyCode, IR_Int
DO
print "waiting . . . "
pause 100
LOOP
IR_Int:
PRINT "*** IR Detected ***"
IRETURN
As Grogsteralso says, I strongly suspect that if all your connections are correct and you get no response to the above code then the IR Transmitter is of the incorrect protocol (the inbuilt IR function requires a particular Sony protocol). Most (but not all) transmitters use either a Sony protocol or an NEC protocol.
There is example code that you can use if you have an NEC protocol Transmitter - but as mentioned above it doesn't use the inbuilt IR command.
Let us know how you get on . . .
WW
|
|
nglordi Newbie
 Joined: 09/01/2015 Location: United StatesPosts: 4 |
Posted: 03:05pm 10 Jan 2015 |
Copy link to clipboard |
 Print this post |
|
Problem solved.
I had changed batteries in the remote and forgot to reprogram it.
Nick |
|
Grogster
 Admin Group
 Joined: 31/12/2012 Location: New ZealandPosts: 9586 |
Posted: 03:16pm 10 Jan 2015 |
Copy link to clipboard |
 Print this post |
|
Good work. Have fun.
Some remotes remember their codes, but your one obviously did not. Smoke makes things work. When the smoke gets out, it stops! |
|