Übungen zur RGB-LED

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Ursukar
Date:
Sat Jan 11 11:58:27 2020 +0000
Parent:
1:1f8c1c63e73a
Commit message:
Inklusive 10k cycling

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 1f8c1c63e73a -r b57e33335e5e main.cpp
--- 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);
      }