fsfs
Dependencies: 4DGL-uLCD-SE LSM303D mbed
Fork of LSM303D_SPI by
Revision 2:2a81657780dc, committed 2015-03-23
- Comitter:
- hassan_elahi
- Date:
- Mon Mar 23 19:19:26 2015 +0000
- Parent:
- 1:bad5121a35c7
- Commit message:
- fsfs
Changed in this revision
--- a/LSM303D.lib Thu Jan 15 19:55:22 2015 +0000 +++ b/LSM303D.lib Mon Mar 23 19:19:26 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/DrCoyle/code/LSM303D/#f186dd92c836 +http://developer.mbed.org/users/hassan_elahi/code/LSM303D/#171076b97de0
--- a/LSM303D_SPI.lib Thu Jan 15 19:55:22 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://developer.mbed.org/users/shurjo_1234/code/LSM303D_SPI/#684294feee71
--- a/main.cpp Thu Jan 15 19:55:22 2015 +0000 +++ b/main.cpp Mon Mar 23 19:19:26 2015 +0000 @@ -6,6 +6,7 @@ SPI spi2(p11, p12, p13); Serial pc(USBTX, USBRX); // tx, rx +//Serial device(p9, p10); LSM303D sensor1(spi,p15); LSM303D sensor2(spi,p16); @@ -14,10 +15,14 @@ LSM303D sensor5(spi2,p27); LSM303D sensor6(spi2,p28); -LSM303D sensor7(spi2,p29); -LSM303D sensor8(spi2,p30); +//LSM303D sensor7(spi2,p29); +//LSM303D sensor8(spi2,p30); + DigitalOut myled(LED1); + int main() { + //wait(2); + pc.baud(115200); sensor1.initialize(); sensor2.initialize(); sensor3.initialize(); @@ -25,13 +30,21 @@ sensor5.initialize(); sensor6.initialize(); - sensor7.initialize(); - sensor8.initialize(); + // sensor7.initialize(); + // sensor8.initialize(); + + int i=0; + char c = 'a'; + //c=c+1; + //int m=0xAAAAAAAA; + //pc.printf("%c",c); + + while (true) { - char c = pc.getc(); + //char c = pc.getc(); int a[] = {sensor1.magnitometer(0), sensor1.magnitometer(1), sensor1.magnitometer(2), @@ -39,12 +52,39 @@ sensor3.magnitometer(0), sensor3.magnitometer(1), sensor3.magnitometer(2), sensor4.magnitometer(0), sensor4.magnitometer(1), sensor4.magnitometer(2), sensor5.magnitometer(0), sensor5.magnitometer(1), sensor5.magnitometer(2), - sensor6.magnitometer(0), sensor6.magnitometer(1), sensor6.magnitometer(2), + sensor6.magnitometer(0), sensor6.magnitometer(1), sensor6.magnitometer(2)};/*, sensor7.magnitometer(0), sensor7.magnitometer(1), sensor7.magnitometer(2), - sensor8.magnitometer(0), sensor8.magnitometer(1), sensor8.magnitometer(2)}; + sensor8.magnitometer(0), sensor8.magnitometer(1), sensor8.magnitometer(2)};*/ - int t = a[c-'a']; + + pc.printf("%c",' '); + pc.printf("%c",'a'); + pc.printf("%c",' '); + pc.printf("%c",'b'); + + for (i=0;i <18; i++) + { + int t = a[i]+32768; + pc.printf("%c",' '); + pc.printf("%d",t); + } + myled = !myled; + /*if (i >17) + { + i=0; + pc.printf("%c",' '); + pc.printf("%c",'a'); + pc.printf("%c",' '); + pc.printf("%c",'b'); + myled = !myled; + } + + int t = a[i]+32768; + + pc.printf("%c",' '); pc.printf("%d",t); + i=i+1;*/ + }