Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LSM303DLH_pico

LSM303DLH example in C for Raspberry Pi pico

Connections on Raspberry Pi Pico board -

GPIO PICO_DEFAULT_I2C_SDA_PIN (On Pico this is GP4 (e.g. pin 6)) -> SDA
GPIO PICO_DEFAULT_I2C_SCL_PIN (On Pico this is GP5 (e.g. pin 7)) -> SCL
3.3v (e.g. pin 36) -> VCC
GND (e.g. pin 38) -> GND

Getting started -

After you've wired your LSM303DLH breakout board run the example I2C bus scan to get the two I2C interface adressess (The IC has two interfaces - one for the accelerometr and second for the magnetometr) and update the inteface adresses in lsm303dlh.h

Or alternatively you can run my altered version of the scan to display the result via USB and use a terminal tool such as GTKTerm or PuTTY.

Building -

As stated in Getting started with Raspberry Pi pico chapter 8 -

$ mkdir build
$ cd build
$ export PICO_SDK_PATH=../../pico-sdk
$ cmake ..
$ make

some previous steps are necessary - please refer to chapter 2 of the material stated higher.

License

Code is published under the MIT License
Copyright (c) 2022 Tomas Dudacek

About

LSM303DLH example in C for Raspberry Pi pico

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages