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
main.cpp
- Committer:
- takuma1
- Date:
- 2020-09-04
- Revision:
- 0:4dafd42a62ef
File content as of revision 0:4dafd42a62ef:
#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;
}
}
}