![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Test gyroscope L3GD20H - programme à tester
Dependencies: mbed C12832_lcd L3GD20H
main.cpp
- Committer:
- LouisReynier
- Date:
- 2022-03-07
- Revision:
- 0:a385e7f763f9
File content as of revision 0:a385e7f763f9:
#include "mbed.h" #include "L3GD20H.h" #include "C12832_lcd.h" // Test Capteur L3GD20H // application board mbed // affichage des vitesse angulaires // short = int 16 bit -32768..32767 // scl:p27 et sda:p28 // programme à tester DigitalOut myled(LED1); L3GD20H gyro(p28, p27); C12832_LCD lcd; short g[3]; // tableau de 3 shorts int main() { while(1) { gyro.read(g); // lecture des 3 valeurs lcd.locate(0,0); // Set Location print a text lcd.printf("Vx=%d ",g[0]); lcd.locate(0,10); // Set Location print a text lcd.printf("Vy=%d ",g[1]); lcd.locate(0,20); // Set Location print a text lcd.printf("Vz=%d ",g[2]); } }