Test

Revision:
2:e7101cf1ca6e
Parent:
1:56cb59d5a0e6
Child:
3:17fe954e8cfc
--- a/main.cpp	Wed Mar 23 15:07:28 2022 +0000
+++ b/main.cpp	Wed Mar 23 16:52:21 2022 +0000
@@ -1,33 +1,15 @@
 #include "mbed.h"
-#include<stdio.h>
-#include<string.h>
 
 /* !!!Change pins according to your connection!!! */
-//DigitalOut RST_KEY(D4,0);
-//DigitalOut LOW_PWR_KEY(D5,1);
-DigitalOut PWR_KEY(D9,1);
-
-/*DigitalOut LED_R(D7,1);
-DigitalOut LED_G(D8,1);
-DigitalOut LED_B(D9,1);*/
-
-
-/* !!!Change pins according to your connection!!! */
-BufferedSerial uart(D8,D2, 115200); // UART TX, RX
+BufferedSerial uart(PD10,PD2 115200); // UART TX, RX
 ATCmdParser module(&uart,"\r\n");
 
 // init the module
 bool ModulePowerOn() {
-    int i=0;
     bool result = false;
-    RST_KEY = 0;
-    thread_sleep_for(3000);
-    RST_KEY = 1;
-    thread_sleep_for(15000);
-
     result =  module.recv("OK");
     if(!result){
-        for(i=0;i<10;i++){
+        for(int i=0;i<10;i++){
             module.send("AT");
             thread_sleep_for(500);
             result =  module.recv("OK");