Grove collision sensor example. This example program demonstrates usage of the Grove collision sensor from Seeed studio.

Dependencies:   mbed

Fork of Seeed_Grove_Collision_Sensor_Example by Austin Blackstone

Files at this revision

API Documentation at this revision

Comitter:
mbedAustin
Date:
Wed Sep 03 19:09:25 2014 +0000
Child:
1:ad4f4815bcde
Commit message:
Seed Studio collision sensor example with sample rate of 1 per second.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 03 19:09:25 2014 +0000
@@ -0,0 +1,21 @@
+
+#include "mbed.h"
+
+DigitalIn sig1(D2);
+
+int main()
+{
+    bool value1;
+    
+    while(1){
+        value1 = sig1;
+
+        if(sig1 == 0)
+        {
+            printf("Collision detected!\n\r");
+            wait(1);    // 1 second delay
+        }
+        
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 03 19:09:25 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013
\ No newline at end of file