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.
main.cpp
00001 #include "SCA3000.h" 00002 00003 Serial pc(USBTX, USBRX); 00004 SCA3000 accelerometer(p5, p6, p7, p8, p9); 00005 00006 int main() { 00007 00008 pc.printf("Starting SCA3000 test...\n"); 00009 00010 int revision = accelerometer.getRevId(); 00011 00012 pc.printf("Device revision number is: %i.%i\n", revision & 0xF0, revision & 0x0F); 00013 00014 00015 while(1){ 00016 00017 //Arbitrary wait for printf clarity. 00018 wait(0.1); 00019 00020 //Print out the acceleration measured on each axis in milli-gs. 00021 pc.printf("x:%f y:%f z:%f\n", accelerometer.getAcceleration(SCA3000_X_AXIS), 00022 accelerometer.getAcceleration(SCA3000_Y_AXIS), 00023 accelerometer.getAcceleration(SCA3000_Z_AXIS)); 00024 00025 } 00026 00027 }
Generated on Thu Jul 14 2022 03:44:09 by
