Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DmTouch_UniGraphic UniGraphic mbed
Fork of DAY_8_miniproject by
accel_sensor.cpp
00001 #include "accel_sensor.h" 00002 00003 void acceleration_n(void){ 00004 cs=1; 00005 acc.format(8,3); 00006 acc.frequency(2000000); 00007 cs=0; 00008 acc.write(0x31); 00009 acc.write(0x0B); 00010 cs=1; 00011 cs=0; 00012 acc.write(0x2D); 00013 acc.write(0x08); 00014 cs=1; 00015 00016 while(1){ 00017 wait(0.2); 00018 cs=0; 00019 acc.write(0x80|0x40|0x32); 00020 for (int i = 0; i <=5;i++){ 00021 buffer[i]=acc.write(0x00)); 00022 } 00023 cs=1; 00024 data[0]=buffer[1]<<8|buffer[0]; 00025 data[1]=buffer[3]<<8|buffer[2]; 00026 x=0.004*data[0]; y=0.004*data[1]; 00027 } 00028 }
Generated on Fri Jul 15 2022 09:32:54 by
1.7.2
