This sensor uses the [[msensor|Using the Mindstorms Sensor Device Class]] device class.
Value | |
---|---|
type_id |
33 |
# Modes | 6 |
Connection | UART |
Mode 0 | Mode 1 | Mode 2 | Mode 3 | Mode 44 | Mode 55 | |
---|---|---|---|---|---|---|
mode
| IR-PROX
| IR-SEEK
| IR-REMOTE
| IR-REM-A
| IR-S-ALT
| IR-CAL
|
Description | Proximity | IR Seeker1 | IR Remote Control2 | Alternate IR Remote Control | Alternate IR Seeker | Calibration??? |
num_values
| 1
| 8
| 4
| 1
| 4
| 2
|
value0
| Proximity (distance) | Channel 1 Heading | Channel 1 | Channel 13 | ??? | |
Min | 0 (very close)
| -25 (far left)
| 0 (none)
| 0 (???) | 0 (???) | |
Max | 100 (far away - approx. 70cm/27in)
| 25 (far right)
| 11 (blue up and blue down)
| 100 (???) | 1023 (???) | |
value1
| Channel 1 Proximity | Channel 2 | ??? | |||
Min | 0 (close)
| 0 (none)
| 0 (???) | 0 (???) | ||
Max | 100 (far away - approx. 200cm/79in)
| 11 (blue up and blue down)
| 100 (???) | 1023 (???) | ||
value2
| Channel 2 Heading | Channel 3 | ??? | |||
Min | -25
| 0 (none)
| 0 (???) | |||
Max | 25
| 11 (blue up and blue down)
| 100 (???) | |||
value3
| Channel 2 Proximity | Channel 4 | ??? | |||
Min | 0
| 0 (none)
| 0 (???) | |||
Max | 100
| 11 (blue up and blue down)
| 100 (???) | |||
value4
| Channel 3 Heading | |||||
Min | -25
| |||||
Max | 25
| |||||
value5
| Channel 3 Proximity | |||||
Min | 0
| |||||
Max | 100
| |||||
value6
| Channel 4 Heading | |||||
Min | -25
| |||||
Max | 25
| |||||
value7
| Channel 4 Proximity | |||||
Min | 0
| |||||
Max | 100
| |||||
units
| pct (percentage)
| pct (percentage)
| btn (button2)
| none3 | pct (percentage)
| none |
dp (decimal places)
| 0
| 0
| 0
| 0
| 0
| 0
|
[1]: The absence of a beacon on a channel can be detected when Proximity == -128 (and heading == 0).
Value | Description |
---|---|
0 | none |
1 | red up |
2 | red down |
3 | blue up |
4 | blue down |
5 | red up and blue up |
6 | red up and blue down |
7 | red down and blue up |
8 | red down and blue down |
9 | beacon mode on |
10 | red up and red down |
11 | blue up and blue down |
if ((value & 0x0F) == 0) {
// no buttons are pressed
} else {
if (value & 0x80)
// blue down button is pressed
if (value & 0x40)
// blue up button is pressed
if (value & 0x20)
// red down button is pressed
if (value & 0x10)
// red up button is pressed
}
Bits 0-3 seem to be some sort of checksum or parity check. Bit 0 = bit 4, bit 1 = ~(bit 5), bit 2 = ~(bit 6), bit 3 = 0 if bits 0-2 are even or 1 if bits 0-2 are odd.
Also, when the beacon mode is active or for about 1 second after any button is released the value is 262. This mode only works with the remote on channel 1.
Value | Blue Down | Blue Up | Red Down | Red Up |
---|---|---|---|---|
262/384 | ||||
287 | X | |||
300 | X | |||
309 | X | X | ||
330 | X | |||
339 | X | X | ||
352 | X | X | ||
377 | X | X | X | |
390 | X | |||
415 | X | X | ||
428 | X | X | ||
437 | X | X | X | |
458 | X | X | ||
467 | X | X | X | |
480 | X | X | X | |
505 | X | X | X | X |
X = Button pressed |