Hello world for small Sparkfun solenoid
Revision 0:76a291b4c5db, committed 2015-10-29
- Comitter:
- 4180_1
- Date:
- Thu Oct 29 16:38:37 2015 +0000
- Commit message:
- ver 1.0
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 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);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 29 16:38:37 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file
Small 5VDC Sparkfun Solenoid