WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation


The Sparkfun Razor 9DoF IMU board contains an accelerometer, gyros for roll, pitch and yaw and a magnetometer compass and communicates with your board via a TTL level UART, or directly to your PC with the addition of a (MAX232 type) level shifter.
Based on an 8MHz ATmel ATMega328 processor the firmware for this sensor can be programmed using this library - meaning that you can write your own code to be installed on the sensor. The supplied board contains firmware allowing it to be accessed via a serial terminal like Hyperterminal.
Suitable firmware for the board is available via many sources but this library currently supports firmware from Admin at the Society of Robots and so the sensor will need this firmware to be uploaded prior to use by this library. This can be found here: http://www.societyofrobots.com/robotforum/index.php?topic=11599.msg88205#msg88205
WebbotLib does not currently support the firmware supplied pre-installed on the board.
As the device is accessed over a uart then the device can be created by specifying a uart and a baud rate (default is 38,400 baud) ie:
RAZOR imu = MAKE_RAZOR( UART2, 38400);
Like most sensors it needs to be initialised in appInitHardware using:
The device can then be read in your main loop using:




razorLED(const RAZOR* razor, boolean on)

Controls the status LED on the Razor board.
The second parameter allows you to specify if the LED should be turned on or off.

Valid XHTML 1.0 Transitional