bms lv

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
nemanja1994
Date:
Mon Mar 25 23:29:10 2019 +0000
Parent:
1:a2d940c93002
Commit message:
hfh;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a2d940c93002 -r 86cf05e531e6 main.cpp
--- a/main.cpp	Mon Mar 25 23:21:03 2019 +0000
+++ b/main.cpp	Mon Mar 25 23:29:10 2019 +0000
@@ -101,8 +101,14 @@
     
     set_number_of_cells(4);
     while(1) {
-        for (int i=0;i<4;i++){
-            readCellVoltage(i);
-            }
+        // print voltage of each cell starting from the one closest to the GND 
+        pc.printf("The voltage of cell number %d is %.2f V\n",1,readCellVoltage(0));
+        wait(1);
+        pc.printf("The voltage of cell number %d is %.2f V\n",2,readCellVoltage(1));
+        wait(1);
+        pc.printf("The voltage of cell number %d is %.2f V\n",3,readCellVoltage(6));
+        wait(1);
+        pc.printf("The voltage of cell number %d is %.2f V\n",4,readCellVoltage(7));
+        wait(1);
     }
 }