Test gyroscope L3GD20H - programme à tester
Dependencies: mbed C12832_lcd L3GD20H
Revision 0:a385e7f763f9, committed 2022-03-07
- Comitter:
- LouisReynier
- Date:
- Mon Mar 07 17:55:16 2022 +0000
- Commit message:
- Test capteur L3GD20
Changed in this revision
diff -r 000000000000 -r a385e7f763f9 C12832_lcd.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832_lcd.lib Mon Mar 07 17:55:16 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/dreschpe/code/C12832_lcd/#8f86576007d6
diff -r 000000000000 -r a385e7f763f9 L3GD20H.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/L3GD20H.lib Mon Mar 07 17:55:16 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/julioefajardo/code/L3GD20H/#81b60e58e9e1
diff -r 000000000000 -r a385e7f763f9 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Mar 07 17:55:16 2022 +0000 @@ -0,0 +1,29 @@ +#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]); + } +}
diff -r 000000000000 -r a385e7f763f9 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Mar 07 17:55:16 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file