Übungen zur RGB-LED

Dependencies:   mbed

Revision:
2:b57e33335e5e
Parent:
1:1f8c1c63e73a
--- a/main.cpp	Sat Jan 11 10:29:14 2020 +0000
+++ b/main.cpp	Sat Jan 11 11:58:27 2020 +0000
@@ -17,9 +17,10 @@
 void timeCounter(); // Counts PWM steps in binary
 
 int main() {
-    ledR.period(0.01f);
+    ledR.period(0.0001f);
+    // Ticker t1 gets called after 10000 cycles
     t1.attach(callback(&LedR), 0.0001f * 10000);
-    t_ledStrip.attach(callback(&timeCounter), 0.0001f * 10000);
+    t_ledStrip.attach(callback(&timeCounter), 0.0001f* 10000);
     
 }
 
@@ -27,8 +28,8 @@
 // up to 30%
  void LedR()
 {
-     ledR.write(ledR.read() + 0.001f);
-     if(ledR.read() >= 0.03f)
+     ledR.write(ledR.read() + 0.01f);
+     if(ledR.read() >= 0.3f)
      {
          ledR.write(0.0f);
      }