Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Revision 0:4dafd42a62ef, committed 2020-09-04
- 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