Hello world for small Sparkfun solenoid
Diff: main.cpp
- Revision:
- 0:76a291b4c5db
diff -r 000000000000 -r 76a291b4c5db main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Oct 29 16:38:37 2015 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+DigitalOut Ctrl(p8); //Solenoid output control bit
+
+int main() {
+ while(1) {
+ Ctrl = 1; //ON
+ myled = 1;
+ wait(0.5);
+ Ctrl = 0; //OFF
+ myled = 0;
+ wait(2);
+ }
+}
Small 5VDC Sparkfun Solenoid