Data Sheet

Core Spartan Documentation Modern Robotics, Inc
Version 3.0.3 Page 47
9.4. Range Sensor (45-2008)
The Range Sensor combines ultrasonic and optical distance measuring elements to
obtain a reading between 1cm and 255cm. This is where the optical sensor comes in use
because it can detect objects within 15cm. Refer to the Range Sensor example folder for
more information on different implementation methods.
.
http://modernroboticsinc.com/range-sensor
Default I2C Address = 0x28
Arduino I2C Address = 0x14
Range Sensor functions:
CORE_RANGE_SENSOR(int address)
unsigned char ultrasonic(void)
unsigned char optical(void)
CORE_RANGE_SENSOR(int address)
Save the I2C address for future reads and writes.
This must be done before setup().
CORE_RANGE_SENSOR RANGE;
…or…
CORE_RANGE_SENSOR RANGE(0x14);
unsigned char ultrasonic(void);
This function allows the user to read the ultrasonic reading from the Range
Sensor. The ultrasonic reading is accurate from 12cm to 250cm.
int value;
value = RANGE.ultrasonic();
…or…
Serial.print(RANGE.ultrasonic());