When the bioloid engine is ready, you can create Sensor objects ( same way as Motor objects ). Then you can access to their different members which return all values of an AX-S1 module.
To create a new sensor uobject (AX-S1 #ID is 100 in this example):
sensor = new Sensor (100);
The AX-S1 dynamixel sensor module is accessed through the Sensor
object and have the following attributes :
Table 4.3. AX-S1 Sensor attributes
| Name | Rangemin | Rangemax | Description |
|---|---|---|---|
| IR sensors | |||
| irC (irC.val) | 0 | 255 | 0x1B Read Centered InfraRed sensor values. Distance from 0 to 255. |
| irL (irL.val) | 0 | 255 | 0x1A Read Left InfraRed sensor values. 255 is very close |
| irR (irR.val) | 0 | 255 | 0x1C Read Right InfraRed sensor values. 0 is nothing there |
| Light sensors | |||
| lightC (lightC.val) | 0 | 1 | 0x1E Read Centered Light values (triggers). 0 or 1. |
| lightL (lightL.val) | 0 | 1 | 0x1D Read Left Light values (triggers). 0 or 1. |
| lightR (lightR.val) | 0 | 1 | 0x1F Read Right Light values (triggers). 0 or 1. |
| light (light.val) | 0 | 7 | 0x21 Read, light detected (lightX value > compare value) |
| lightCompare | 0 | 255 | 0x35 RAM value of threshold compared to lightX |
| lightTheshold | 0 | 255 | 0x15 ROM value, load in RAM (0x35) at power ON |
| Obstacle sensors | |||
| obstacle (obstacle.val) | 0 | 7 | 0x20 Read, Obstacle detected (irX value > compare value) |
| obstacleCompare | 0 | 255 | 0x34 RAM value of threshold compared to irX |
| obstacleThreshold | 0 | 255 | 0x14 ROM value, load in RAM (0x34) at power ON |
| Buzzer | |||
| sound | 0 | 255 | 0x23 return max sound amplitude 0 mini <128 null <255 max |
| soundMaxHold | 0 | 255 | 0x24 low pass filter, 0 for measuring max loudness |
| soundOccurenceCount | 0 | 255 | 0x25 Sound clap counter |
| soundOccurenceTime | 0 | 65535 | 0x26 Time of last detected clap |
| buzzerIndex (speaker.val) | 0 | 51 | 0x28 Note to play. Play note at val assignment 0=la, 1=la#,... |
| buzzerTime | 3 | 50 | 0x29, time to play next note x0.1s (from 0.3 to 5s) |
| Temperature | |||
| temperature (temperature.val) | 0 | 255 | 0x2B Read temperature in celcius degrees |
| temperatureLimit | 0 | 150 | 0x0B Temperature Alerte threshold |
| Power supply | |||
| voltage (voltage.val) | 0 | 255 | 0x2A Read 10 x voltage |
| lowVoltageLimit | 50 | 250 | 0x0C |
| highVoltageLimit | 50 | 250 | 0x0D |
| IR communication | |||
| IRRemoconRX0 (IRRemoconRX0.val) | 0 | 255 | 0x30 Read first byte received |
| IRRemoconRX1 (IRRemoconRX1.val) | 0 | 255 | 0x31 Read second byte received |
| IRRemoconTX0 (IRRemoconTX0.val) | 0 | 255 | 0x32 first byte to transmit |
| IRRemoconTX1 (IRRemoconTX1.val) | 0 | 255 | 0x33 second byte to transmit |
| IRRemoconArrived (IRRemoconArrived.val) | 0 | 255 | 0x2E Read |
| Other Informations | |||
| load | 0 | 1 | .. |
| ID | 0 | 253 | 0x03 Read ID of AX-S1 |
| firmwareVersion | 0 | 255 | 0x02 Read firmware version |
| modelNumber | 0 | 65535 | 0x00 Read model number: is 13 for AX-S1 |
| returnStatus | 0 | 2 | 0x10 |
| baudRate | 0 | 254 | 0x04 baudrate |
| registeredInstruction | 0 | 1 | 0x2C |
| returnDelay | 0 | 254 | 0x05 |
| lock | 1 | 1 | 0x2F |
Here you can find the AX-S1 Specifications for more information.