NuMaker GPIO button with LED and buzzer

Files at this revision

API Documentation at this revision

Comitter:
SHLIU1@OANBE02333.nuvoton.com
Date:
Thu Feb 25 10:55:25 2021 +0800
Parent:
12:dcd1125ab50e
Commit message:
Support the both V5.X and V6.X for mbed-os

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r dcd1125ab50e -r 9982ee238f27 main.cpp
--- a/main.cpp	Thu Apr 19 10:57:02 2018 +0800
+++ b/main.cpp	Thu Feb 25 10:55:25 2021 +0800
@@ -41,7 +41,9 @@
     rgbled_B=1; rgbled_R=1; rgbled_G=1;
     greenled=1;
     buzzer=1;
-                        
+#ifdef MBED_MAJOR_VERSION
+    printf("Mbed OS version %d.%d.%d\r\n\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION);
+#endif                      
     while (true) {
         // press SW1 will turn on greeled and RGBLED=blue
         if (button_SW1==0) {