Vjezba_sinus

Dependencies:   mbed

Revision:
0:35f1fb764f89
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Dec 10 15:53:17 2015 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+ 
+#define INPUT_SCALAR        (0.01f) 
+ 
+AnalogIn Ain(p20);
+AnalogOut Aout(p18);
+float i;
+float pi=3.14159;
+ 
+int main()
+{
+    while(1)  {
+        for (i=0; i<2; i=i+0.005) {
+                                    Aout=0.5+0.5*sin(i*pi);
+                                    wait(Ain*INPUT_SCALAR); 
+            
+        }
+    }
+}
\ No newline at end of file