マイナスの値が出ないように修正

Dependencies:   mbed HMC5883L_2

Committer:
taknokolat
Date:
Thu Feb 07 06:14:43 2019 +0000
Revision:
1:c91577293e84
Parent:
0:26409a44f1f3
Child:
2:ad66e39cb4a1
a; ;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
TUATBM 0:26409a44f1f3 1 #include "mbed.h"
TUATBM 0:26409a44f1f3 2 #include "HMC5883L.h"
TUATBM 0:26409a44f1f3 3
TUATBM 0:26409a44f1f3 4 HMC5883L compass(PB_9, PB_8);
TUATBM 0:26409a44f1f3 5
TUATBM 0:26409a44f1f3 6 int main(){
TUATBM 0:26409a44f1f3 7 int16_t a[3];
TUATBM 0:26409a44f1f3 8 double b;
TUATBM 0:26409a44f1f3 9
TUATBM 0:26409a44f1f3 10 while(1){
TUATBM 0:26409a44f1f3 11 compass.init();
taknokolat 1:c91577293e84 12 b= compass.getHeadingXYDeg(20,50);
TUATBM 0:26409a44f1f3 13 printf("%lf\r\n",b);
taknokolat 1:c91577293e84 14
taknokolat 1:c91577293e84 15 // wait(0.);
TUATBM 0:26409a44f1f3 16 }
TUATBM 0:26409a44f1f3 17
TUATBM 0:26409a44f1f3 18 /*while(1){
TUATBM 0:26409a44f1f3 19 compass.getXYZ(a);
taknokolat 1:c91577293e84 20 //printf("%d, %d, %d,\r\n",a[0],a[2]-150,a[1]);
taknokolat 1:c91577293e84 21 printf("%d, %d\r\n",a[0]+20,a[2]+50);
taknokolat 1:c91577293e84 22 //wait(1);}
taknokolat 1:c91577293e84 23
TUATBM 0:26409a44f1f3 24
taknokolat 1:c91577293e84 25 }*/
taknokolat 1:c91577293e84 26 }