Opdracht 1 met de motor. Functioneert nog niet.

Dependencies:   mbed

Revision:
0:3231a9b1147f
Child:
1:2a6e34a26b8a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 19 14:18:48 2017 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+
+AnalogIn potmeter(A1);  //Analog input of the potmeter
+PwmOut led2(D6);        //Biorobotics LED connect (D6)
+PwmOut led1(D5);        //Biorobotics LED connect (D5)
+
+float PwmPeriod = 1.0/5000.0;   //PWM period (5000 Hz)
+
+int mmain() {
+    led2.period(PwmPeriod);      //Set PWM period at 5000 Hz
+    
+    while(true){
+        led2 = potmeter.read();  //Set brightness of let (0,1)
+        wait(0.1f);
+    }
+}
\ No newline at end of file