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

ST/LY530ALH.h

The LY530AL is a single axis gyro that can measure yaw rotations up to 1200 degrees per second.
Data sheet: http://www.sparkfun.com/datasheets/Sensors/IMU/LY530ALH.pdf
Requires 1 ADC channels.
Note that the device requires a 3.3v supply.
The device operates in two modes:-
Note that this is not a 'software setting' and so this library cannot automatically choose the correct value. It actually depends on which pin on the device you use to connect to the ADC. The 'SLOW' option is referred to in the data sheet as the '4.5' output (coz its like the 'FAST' speed divided by 4.5).
To create the device use:-
LY530ALH yaw = MAKE_LY530ALH(ADC0,slow)
Where slow is TRUE for the SLOW output, or FALSE for the FAST output.
Don't forget that you should initialise the device in appInitHardware:-
gyroInit(yaw);
You can read the device by using:
gyroRead(yaw);
and then the results are in:-
yaw.gyro.z_axis_degrees_per_second

Valid XHTML 1.0 Transitional