Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.

Dependencies:   Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo

Embed: (wiki syntax)

« Back to documentation index

L3G4200D Class Reference

L3G4200D Class Reference

Interface library for the ST L3G4200D 3-axis gyro. More...

#include <L3G4200D.h>

Public Member Functions

 L3G4200D (PinName sda, PinName scl)
 Create a new L3G4200D I2C interface.
void read (int g[3])
 Read gyro values.
byte readTemp (void)
 Read raw temperature value.

Detailed Description

Interface library for the ST L3G4200D 3-axis gyro.

Ported from Pololu L3G4200D library for Arduino by Michael Shimniok http://bot-thoughts.com

 #include "mbed.h"
 #include "L3G4200D.h"
 L3G4200D gyro(p28, p27);
 ...
 int g[3];
 gyro.read(g);

Definition at line 82 of file L3G4200D.h.


Constructor & Destructor Documentation

L3G4200D ( PinName  sda,
PinName  scl 
)

Create a new L3G4200D I2C interface.

Parameters:
sdais the pin for the I2C SDA line
sclis the pin for the I2C SCL line

Definition at line 44 of file L3G4200D.cpp.


Member Function Documentation

void read ( int  g[3] )

Read gyro values.

Parameters:
gArray containing x, y, and z gyro values
Returns:
g Array containing x, y, and z gyro values

Definition at line 77 of file L3G4200D.cpp.

byte readTemp ( void   )

Read raw temperature value.

Returns:
temperature value in raw byte form

Definition at line 101 of file L3G4200D.cpp.