diff --git a/sodaq_one/compass.ino b/sodaq_one/compass.ino index bfc6761..26adc85 100644 --- a/sodaq_one/compass.ino +++ b/sodaq_one/compass.ino @@ -12,12 +12,22 @@ void setupCompass() compass.enableDefault(); } -void readCompass() +String getCompass() { - compass.read(); + String tmps; + compass.read(); - snprintf(compassReport, sizeof(compassReport), "A: %6d %6d %6d M: %6d %6d %6d", - compass.a.x, compass.a.y, compass.a.z, - compass.m.x, compass.m.y, compass.m.z); + tmps = String("compass.a.x=" ) + compass.a.x + + String(" compass.a.y=" ) + compass.a.y + + String(" compass.a.z=" ) + compass.a.z + + String(" compass.m.x=" ) + compass.m.x + + String(" compass.m.y" ) + compass.m.y + + String(" compass.m.z=" ) + compass.m.z; + + debugSerial.println(tmps); + + /* snprintf(compassReport, sizeof(compassReport), "A: %6d %6d %6d M: %6d %6d %6d", */ + /* compass.a.x, compass.a.y, compass.a.z, */ + /* compass.m.x, compass.m.y, compass.m.z); */ } diff --git a/sodaq_one/sodaq_one.ino b/sodaq_one/sodaq_one.ino index 6f68730..b2fe16c 100644 --- a/sodaq_one/sodaq_one.ino +++ b/sodaq_one/sodaq_one.ino @@ -11,11 +11,6 @@ #define USE_LOUDNESS 1 #define BUZZER_PIN 2 -void sendBatVoltage() { - String battery = String("bat1=") + String(getBatteryVoltage()); - sendPacket(battery); -} - void signal_loop_start() { blink(30); delay(50); @@ -53,7 +48,6 @@ void sendIntAsString(String prefix, int value) { } String tmps; -int tmpi; void loop() { signal_loop_start(); @@ -61,15 +55,8 @@ void loop() { loraSend(String("node=") + String(deviceNo)); sendIntAsString("battery=", getBatteryVoltage()); sendIntAsString("loudness=", readLoudness()); - - tmps = getSunLight(); - debugSerial.println(tmps); - loraSend(tmps); - - readCompass(); - debugSerial.println(compassReport); - - // buzz(30); + loraSend(getSunLight()); + loraSend(getCompass()); /* if((tmps = gpsGetPostion(120)) != "") { */ /* loraSend(tmps); */