Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tapiocode/pico-l3g4200d

Repository files navigation

pico-l3g4200d

A lightweight driver for the STMicroelectronics L3G4200D 3-axis gyroscope for Raspberry Pi Pico C/C++ SDK.

The project is built with the official Raspberry Pi Pico VSCode extension.

Features

  • Raw and corrected gyroscope reading (with bias calibration)
  • Configurable measurement ranges (250, 500, 2000 dps)
  • I2C-based communication with automatic bias calibration.
  • Defaults: port i2c0, pins SDA 4, SCL 5

Example Program

The example program should output log on a successful run as follows:

L3G4200D initialized
L3G4200D calibrating bias...
L3G4200D calibrated: bias X=0.50 Y=-0.22 Z=-0.20
example.c: Reading gyroscope data (5ms = 200Hz)...
example.c: X:    0.59 | Y:    0.66 | Z:   -0.24 deg/s
example.c: X:   -0.04 | Y:   -0.38 | Z:    0.32 deg/s
example.c: X:   -0.13 | Y:    0.34 | Z:    0.28 deg/s
example.c: X:   -0.42 | Y:    0.15 | Z:    0.85 deg/s
...

License

MIT

About

A lightweight L3G4200D 3-axis gyroscope driver for Raspberry Pi Pico C/C++ SDK

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published