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.
Fork of MMA8452 by
Revision 1:0c1dd02be97a, committed 2012-11-28
- Comitter:
- matsu
- Date:
- Wed Nov 28 17:05:31 2012 +0000
- Parent:
- 0:904e837fccc5
- Commit message:
- ver1:get analog data from MMA8452
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Nov 28 16:55:32 2012 +0000 +++ b/main.cpp Wed Nov 28 17:05:31 2012 +0000 @@ -33,7 +33,6 @@ wait(0.07); switch(number){ case 0: -// i2c.start(); if(i2c.write(0x3A,add,1) == 0){ number++; led1 = 1; @@ -45,7 +44,6 @@ } break; case 1: -// i2c.start(); if(i2c.read(0x3A,cmd,6) == 0){ number++; led2 = 1; @@ -57,7 +55,7 @@ } break; case 2: -// pc.printf("\r cmd1 = %d,cmd2 = %d,cmd3 = %d ",((cmd[0]<<4)+(cmd[1]>>4)),((cmd[2]<<4)+(cmd[3]>>4)),((cmd[4]<<4)+(cmd[5]>>4))); + //get analog data pc.printf("\r X = %d,Y = %d,Z = %d ",cmd[1],cmd[3],cmd[5]); led3 = 1; wait(0.5);