Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:01afb35ba995
- Child:
- 1:9b3491c0f6b8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Oct 31 11:19:11 2018 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "Servo.h"
+
+//Ticker servo;
+//void signal_servo(){}
+
+
+Servo myservo(D7);
+DigitalIn but_1(SW2);
+
+void servocontrol()
+{
+ if (but_1)
+ {
+ myservo = 0.1;
+ }
+ else
+ {
+ myservo = 0.0;
+ }
+}
+
+int main()
+{
+ while (1)
+ {
+ servocontrol();
+ wait(0.01);
+ }
+}
\ No newline at end of file