Dependencies:   mbed Servo

Revision:
1:d8964d9ff503
Parent:
0:b8bade04f24f
--- a/main.cpp	Thu Sep 03 21:45:56 2020 +0000
+++ b/main.cpp	Thu Sep 10 16:01:56 2020 +0000
@@ -28,10 +28,13 @@
 SDFileSystem sd(PB_5, PB_4, PB_3, PA_11, "sd"); //MOSI,MISO,SCK,CS the pinout on the mbed Cool Components workshop board
 
 // activation 3.3V power supply on sensors board
-DigitalOut activ_sensors(PA_7); //
+DigitalOut activ_sensors(PA_12); //
 // Analog pin sensors : battery and temperature
 AnalogIn   batin(PA_0);//battery pin pA0
 AnalogIn   tempin(PA_1);//temperature pin pa1
+AnalogIn   sp_1in(PA_6);//Solar Panel 1 pin pa1
+AnalogIn   sp_2in(PA_5);//Solar Panel 2 pin pa1
+
 uint8_t g_image_buffer[IMAGE_JPG_SIZE];
 
 void telegram_bot();
@@ -299,15 +302,18 @@
     unsigned char stop=0;
     activ_sensors = 1;
     pc.printf("\r\n/*----------------------------------------------*/\r\n");
-    pc.printf("\t Battery level and temperature sensor test\r\n");
+    pc.printf("\t Battery level, temperature sensor test\r\n");
+    pc.printf("\t Solar Panel 1 and 2 Currents test\r\n");
     pc.printf("send \"s\" to stop\r\n");
     pc.printf("/*----------------------------------------------*/\r\n");
     wait(2);    
     do
     {
         wait_ms(300);
-        pc.printf("battery: %.2f V\t\t",batin.read()*4.59f);        // 3.3 * 13.9/10
-        pc.printf("temperature: %.1f degC\r\n",(tempin.read()*3.3f-0.5f)/0.01f);
+        pc.printf("battery: %.2f V\t\t",batin.read()*4.59f+0.32f);        // 3.3 * 13.9/10 + 0.32 (Vd)
+        pc.printf("temperature: %.1f degC\t\t",(tempin.read()*3.3f-0.5f)/0.01f);
+        pc.printf("solar panel 1: %.1f mA\t",(sp_1in.read()*3.3f*50));
+        pc.printf("and 2: %.1f mA\r\n",(sp_2in.read()*3.3f*50));
         if(pc.readable())
             stop=pc.getc();
      }while(stop!='s');   
@@ -328,7 +334,7 @@
     pc.printf("\t2. Test SDCARD\r\n");
     pc.printf("\t3. Test GPS\r\n");
     pc.printf("\t4. Test CAMERA\r\n");
-    pc.printf("\t5. Test temperature sensor & battery level \r\n");
+    pc.printf("\t5. Test Analog Sensors\r\n");
     pc.printf("\t6. Test XBEE communication\r\n");
     pc.printf("\t7. Quit\r\n");
     pc.printf("/*-------------------------------------------*/\r\n");