ECE595 - Lab 3 Part 2 - Grove Vibration Motor Program - TA

Revision:
0:4cb6e9d0da34
Child:
1:af23cbc41990
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jan 15 23:55:27 2021 +0000
@@ -0,0 +1,19 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2019 ARM Limited
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include "mbed.h"
+
+DigitalIn button(D6);
+
+int main()
+{
+    while(1){
+        if(button){
+            printf("Button Pressed\n\r");
+            wait(0.7); // simple debouncing
+        }           
+    }
+
+}