Zadatak 3-4

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Kzupancic
Date:
Thu Dec 10 14:59:30 2015 +0000
Commit message:
Pulsni valni izlaz

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
diff -r 000000000000 -r 8748fc4ae628 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Dec 10 14:59:30 2015 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+ 
+int main() {
+DigitalOut led1(LED1);
+DigitalIn inputsw(p7);
+inputsw.mode(PullUp); 
+    float tx=0.5;
+    float ty=0.5;
+    
+    while(1){
+    led1=0;
+    wait(tx);
+    led1=1;
+    wait(tx);
+    if(inputsw==1){
+        tx=ty/2.0;
+        }
+        else if (inputsw==0)
+        {
+            tx=ty*2;
+            }
+    }
+}
diff -r 000000000000 -r 8748fc4ae628 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Dec 10 14:59:30 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/165afa46840b
\ No newline at end of file