From 4f41b89969d4d6807bd2f00c077864e7d6c84bd9 Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Mon, 10 Aug 2020 19:31:53 +0500 Subject: [PATCH] Update main.ts --- main.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/main.ts b/main.ts index 6c1e6c6..2fac6b8 100644 --- a/main.ts +++ b/main.ts @@ -179,9 +179,15 @@ namespace cw01 { basic.pause(200) serial.readString() + let loop_count = 0 + do { cw01_vars.res = serial.readString() basic.pause(1000) + loop_count++ + + if(loop_count == 10) + break } while (!cw01_vars.res.includes("WIFI CONNECTED")); if (cw01_vars.res.includes("WIFI CONNECTED")) { @@ -189,8 +195,13 @@ namespace cw01 { basic.pause(2000) basic.showString("") cw01_vars.res = "" - } else { + } + + if(loop_count == 10) + { basic.showString("D") + basic.pause(2000) + basic.showString("") } }