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

Dependencies:   mbed HMC5883L_2

main.cpp

Committer:
taknokolat
Date:
2019-02-07
Revision:
1:c91577293e84
Parent:
0:26409a44f1f3
Child:
2:ad66e39cb4a1

File content as of revision 1:c91577293e84:

#include "mbed.h"
#include "HMC5883L.h"

HMC5883L compass(PB_9, PB_8); 

int main(){ 
   int16_t a[3];
   double b;
  
   while(1){
       compass.init();
       b= compass.getHeadingXYDeg(20,50);
       printf("%lf\r\n",b);
       
      // wait(0.);
       }
       
   /*while(1){
   compass.getXYZ(a);
   //printf("%d, %d, %d,\r\n",a[0],a[2]-150,a[1]);
   printf("%d, %d\r\n",a[0]+20,a[2]+50);
   //wait(1);}

  
    }*/
}