KIT Solar Car Project / Mbed 2 deprecated BAT_Charge_T1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
takuma1
Date:
Fri Sep 04 04:52:33 2020 +0000
Commit message:
BAT;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Sep 04 04:52:33 2020 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+
+DigitalOut BAT_Discharge_GND(p21);
+DigitalOut BAT_Charge(p22);
+DigitalOut BAT_Normal(p23);
+AnalogIn Driver_Swich(p20);
+
+
+int main() {
+    int count = 0;
+    while(1) {
+            
+            if(Driver_Swich == 1){
+                printf("1\n");
+               BAT_Discharge_GND = 1;
+                if(count == 0){
+                 BAT_Charge = 1;
+                   wait(3);
+                   count++;
+                BAT_Charge = 0;
+                              }
+                BAT_Normal = 1;
+                                 }
+                          
+            if(Driver_Swich == 0){
+                BAT_Normal = 0;
+                BAT_Discharge_GND =0;
+                BAT_Charge = 0;
+                printf("2\n");
+                //wait(2);
+                count = 0;    
+                                 }
+                                 
+           }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Sep 04 04:52:33 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file