Sensors

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

NameRangeminRangemaxDescription
IR sensors   
irC (irC.val)02550x1B Read Centered InfraRed sensor values. Distance from 0 to 255.
irL (irL.val)02550x1A Read Left InfraRed sensor values. 255 is very close
irR (irR.val)02550x1C Read Right InfraRed sensor values. 0 is nothing there
Light sensors   
lightC (lightC.val)010x1E Read Centered Light values (triggers). 0 or 1.
lightL (lightL.val)010x1D Read Left Light values (triggers). 0 or 1.
lightR (lightR.val)010x1F Read Right Light values (triggers). 0 or 1.
light (light.val)070x21 Read, light detected (lightX value > compare value)
lightCompare02550x35 RAM value of threshold compared to lightX
lightTheshold02550x15 ROM value, load in RAM (0x35) at power ON
Obstacle sensors   
obstacle (obstacle.val)070x20 Read, Obstacle detected (irX value > compare value)
obstacleCompare02550x34 RAM value of threshold compared to irX
obstacleThreshold02550x14 ROM value, load in RAM (0x34) at power ON
Buzzer   
sound02550x23 return max sound amplitude 0 mini <128 null <255 max
soundMaxHold02550x24 low pass filter, 0 for measuring max loudness
soundOccurenceCount02550x25 Sound clap counter
soundOccurenceTime0655350x26 Time of last detected clap
buzzerIndex (speaker.val)0510x28 Note to play. Play note at val assignment 0=la, 1=la#,...
buzzerTime3500x29, time to play next note x0.1s (from 0.3 to 5s)
Temperature   
temperature (temperature.val)02550x2B Read temperature in celcius degrees
temperatureLimit01500x0B Temperature Alerte threshold
Power supply   
voltage (voltage.val)02550x2A Read 10 x voltage
lowVoltageLimit502500x0C
highVoltageLimit502500x0D
IR communication   
IRRemoconRX0 (IRRemoconRX0.val)02550x30 Read first byte received
IRRemoconRX1 (IRRemoconRX1.val)02550x31 Read second byte received
IRRemoconTX0 (IRRemoconTX0.val)02550x32 first byte to transmit
IRRemoconTX1 (IRRemoconTX1.val)02550x33 second byte to transmit
IRRemoconArrived (IRRemoconArrived.val)02550x2E Read
Other Informations   
load01..
ID02530x03 Read ID of AX-S1
firmwareVersion02550x02 Read firmware version
modelNumber0655350x00 Read model number: is 13 for AX-S1
returnStatus020x10
baudRate02540x04 baudrate
registeredInstruction010x2C
returnDelay02540x05
lock110x2F

Here you can find the AX-S1 Specifications for more information.