12

Dependencies:   mbed C12832 MMA7660

Committer:
brissou
Date:
Wed Dec 08 14:38:12 2021 +0000
Revision:
7:776375d3aa4d
Parent:
6:8b78adfc4faa
12

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();
dreschpe 0:f6a57b843f79 13
chris 5:636ebfdf373b 14 while(1) {
brissou 7:776375d3aa4d 15 lcd.locate(0,10);
brissou 7:776375d3aa4d 16 lcd.printf("Dessus");
brissou 7:776375d3aa4d 17 lcd.locate(0,20);
brissou 7:776375d3aa4d 18 lcd.printf("Up");
brissou 7:776375d3aa4d 19 lcd.locate(70,0);
rtk 6:8b78adfc4faa 20 lcd.printf("x=%.2f",MMA.x());
brissou 7:776375d3aa4d 21 lcd.locate(70,10);
brissou 7:776375d3aa4d 22 lcd.printf("y=%.2f",MMA.y());
brissou 7:776375d3aa4d 23 lcd.locate(70,20);
brissou 7:776375d3aa4d 24 lcd.printf("z=%.2f",MMA.z());
chris 5:636ebfdf373b 25 wait(0.2);
dreschpe 0:f6a57b843f79 26 }
dreschpe 0:f6a57b843f79 27 }