- Name:
-
irin
- Syntax:
-
IRIN pin, variable
IRIN [timeout], pin, variable
IRIN [timeout, address], pin, variable
Timeout - is a variable/constant which sets the timeout period in milliseconds
Address - is a label which specifies where to go if a timeout occurs
Pin - is a variable/constant which specifies the i/o pin to use
Variable - receives the data
- Description:
-
Wait until a new infrared command is received. This command is similar to the infrain2 command found on other PICAXE devices, but can be used on any input pin. This command is used to wait for an infraout signal from a separate PICAXE chip. It can also be used with an infrared signal from the infrared TV style transmitter (i.e. can replace infrain). All processing stops until the new command is received, but after a timeout period program flow will jump to 'address'. The value of the command received is placed into the defined variable. This will be a number between 0 and 127.
| Start |
Data0 |
Data1 |
Data2 |
Data3 |
Data4 |
Data5 |
Data6 |
ID0 |
ID1 |
ID2 |
ID3 |
ID4 |
| 2.4ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
1.2 or 0.6ms |
To replace an infrain / infrain2 command with irin use these two lines:
| |
symbol infra = b13 |
| |
irin C.0, infra |
Effect of Increased Clock Speed:
This command will automatically use the internal 4MHz resonator for correct operation.
Values received from the TVR010 remote control
TVR010 TV Remote Control |
irout command |
infrain variable data value |
irin variable data value |
| 1 |
irout pin,1,0 |
1 |
0 |
| 2 |
irout pin,1,1 |
2 |
1 |
| 3 |
irout pin,1,2 |
3 |
2 |
| 4 |
irout pin,1,3 |
4 |
3 |
| 5 |
irout pin,1,4 |
5 |
4 |
| 6 |
irout pin,1,5 |
6 |
5 |
| 7 |
irout pin,1,6 |
7 |
6 |
| 8 |
irout pin,1,7 |
8 |
7 |
| 9 |
irout pin,1,8 |
9 |
8 |
| P+ |
irout pin,1,16 |
10 |
16 |
| 0 |
irout pin,1,9 |
11 |
9 |
| V+ |
irout pin,1,18 |
12 |
18 |
| P- |
irout pin,1,17 |
13 |
17 |
| 10+ |
irout pin,1,12 |
14 |
12 |
| V- |
irout pin,1,19 |
15 |
19 |
| MUTE |
irout pin,1,20 |
16 |
20 |
| PWR |
irout pin,1,21 |
17 |
21 |