IR Remote
Rsadeika
Posts: 3,837
What I am trying to do is convert the Parallax IR Remote (Appkit #29122) example program for the Basic Stamp to SX/B; to be used with an sx tech board setup.
I am not having very much sucess, I will post my·code, which is very ugly. If anybody has the time to help out and make the thing work, it would be appreciated.
The next step would be is to make an interrupt handle the IR detect.
Thanks in advance.
I am not having very much sucess, I will post my·code, which is very ugly. If anybody has the time to help out and make the thing work, it would be appreciated.
The next step would be is to make an interrupt handle the IR detect.
Thanks in advance.
Comments
I have a question that arose from my coding attempt, it concerns the use of constants.
An example: irPulse CON 1000
When this gets assembled I get a warning thst states - Warning 37.Pass2. Literal truncated to 8 bits.
1. So, does that mean that constants are limited to a value that is less than 256?
2. Is their a way of getting around this?
3. Is this an SX/B thing or does this also occur in assembly?
If you post your code, I can help further.
Bean.
I think you want:
bit1:
remoteCode.1 = 1
goto bit1bp
bit2:
remoteCode.2 = 1
goto bit2bp
bit3:
remoteCode.3 = 1
goto bit3bp
bit4:
remoteCode.4 = 1
goto bit4bp
bit5:
remoteCode.5 = 1
goto bit5bp
bit6:
remoteCode.6 = 1
goto bit6bp
Hope this helps,
Bean.
The constants question stems from the code I posted.
thStart CON 2 ;this value should be 2400
thPulse CON 1 ;this value should be 500 * 5/2
In the original Basic Stamp code, the constants were used in this manner:
thresholdStart CON 2400
thresholdPulse CON 500 * 5/2
These values are used to check for different pulse rates that the IR Remote strobes out. The thresholdStart is checking for a 2.4ms duration, hence the 2400 value. The thresholdPulse is checking for the data pulse, 1.2ms.
My problem is, how do I check for these exact pulse rates.
So your constant should be 240 anyway.(240 = 2.4mSec)
If you need larger values use the RESOLUTION parameter of PULSIN
Bean.