NuMaker ADC read gas sensor (MQ3)

Revision:
12:015640054db1
Parent:
10:84e277e4aae7
--- a/main.cpp	Thu Apr 19 09:31:55 2018 +0800
+++ b/main.cpp	Wed Feb 24 16:27:23 2021 +0800
@@ -8,11 +8,19 @@
 
 int main(void)
 {
+#ifdef MBED_MAJOR_VERSION
+    printf("Mbed OS version %d.%d.%d\r\n\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION);
+#endif
     printf("ADC0 start reading...\n\r");
     while (1) { 
         printf("ADC0 value= 0x%4x, percentage= %3.3f%%\n\r",adc0.read_u16(), adc0.read()*100.0f);
         if(adc0 > 0.7f) led = 0; // > 0.7 * Vcc wil turn on led
         else            led = 1;
+#if MBED_MAJOR_VERSION >= 6 
+	ThisThread::sleep_for(200);
+#else
         wait(0.2f);
+#endif
+
     }
 }