10

Dependencies:   mbed C12832 MMA7660

Committer:
brissou
Date:
Wed Dec 08 14:35:39 2021 +0000
Revision:
7:f907f3537758
Parent:
6:8b78adfc4faa
ex10

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dreschpe 0:f6a57b843f79 1 #include "mbed.h"
chris 3:2db94ee076ee 2 #include "C12832.h"
chris 5:636ebfdf373b 3 #include "MMA7660.h"
dreschpe 0:f6a57b843f79 4
chris 4:39c7c31b8fb0 5 // Using Arduino pin notation
chris 4:39c7c31b8fb0 6 C12832 lcd(D11, D13, D12, D7, D10);
rtk 6:8b78adfc4faa 7 MMA7660 MMA(I2C_SDA,I2C_SCL);
rtk 6:8b78adfc4faa 8
dreschpe 1:1c6a9eaf55b5 9
dreschpe 0:f6a57b843f79 10 int main()
dreschpe 0:f6a57b843f79 11 {
chris 2:a87e255a8f3a 12 lcd.cls();
rtk 6:8b78adfc4faa 13 lcd.locate(0,0);
rtk 6:8b78adfc4faa 14 lcd.printf("lecture de l'accelerometre");
dreschpe 0:f6a57b843f79 15
chris 5:636ebfdf373b 16 while(1) {
brissou 7:f907f3537758 17 lcd.locate(0,12);
rtk 6:8b78adfc4faa 18 lcd.printf("x=%.2f",MMA.x());
brissou 7:f907f3537758 19 lcd.locate(50,12);
brissou 7:f907f3537758 20 lcd.printf("y=%.2f",MMA.y());
brissou 7:f907f3537758 21 lcd.locate(100,12);
brissou 7:f907f3537758 22 lcd.printf("z=%.2f",MMA.z());
chris 5:636ebfdf373b 23 wait(0.2);
dreschpe 0:f6a57b843f79 24 }
dreschpe 0:f6a57b843f79 25 }