liang brain
/
training_template
trainning_template
Diff: main.cpp
- Revision:
- 5:7534fc9248a8
- Parent:
- 4:fe1e9f9c7b33
diff -r fe1e9f9c7b33 -r 7534fc9248a8 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Dec 01 05:21:19 2020 +0000 @@ -0,0 +1,33 @@ +#define HIGH 1 +#define LOW 0 +#include "mbed.h" +#include <string> +typedef bool boolean; +typedef std::string String; +#include "sensors.h" +#include "converters.h" + +int gasOK; +boolean item; + +Serial Serial_2(PA_2,PA_3); +YL analog_PC_15(PC_15,PA_0); +DigitalOut myDigitalOutPC_13(PC_13); + +int main() { + + +Serial_2.baud(9600); + +item = 0; +while (true) { +item = !item; +myDigitalOutPC_13.write(item); +wait_ms(1000); +if (analog_PC_15==true) { +gasOK = analog_PC_15.read(); +Serial_2.printf("gas: %d\n",_p(gasOK)); +} +} + +} \ No newline at end of file