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:9b09ea979c72
- Child:
- 1:5d1abf5d24a5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Jul 31 18:17:51 2017 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+DigitalIn Pedel(PA_0);
+AnalogIn Pot(PA_7);
+DigitalOut Relay(PB_0);
+
+int main() {
+ Relay = 1 ;
+ float Time = 0 ;
+
+ while(1) {
+ /* myled = 1; // LED is ON
+ wait(0.2); // 200 ms
+ myled = 0; // LED is OFF
+ wait(1.0); // 1 sec
+ */
+ if (Pedel == 0) // Kontrol af pedal tryk
+ {
+ // Time = Pot;
+ Relay = 0;
+ myled = 1; // LED is ON
+ wait(Time);
+ }
+
+ else
+ myled = 0; // LED is OFF
+ Relay = 1;
+
+
+ }
+}
