Ruben Lucas
/
BrightButton
Test script for PwmOut control LED with buttons
Diff: main.cpp
- Revision:
- 1:9654405c52f4
- Parent:
- 0:2ba57c4723ea
--- a/main.cpp Wed Sep 26 12:35:57 2018 +0000 +++ b/main.cpp Fri Sep 28 07:22:53 2018 +0000 @@ -11,7 +11,7 @@ void BrighterFcn() { - if (DutyCycle == 1.0) // check if duty cycle is already at max + if (DutyCycle >= 0.9) // check if duty cycle is already at max {return;} else {DutyCycle = DutyCycle + 0.025;} // raise duty cycle with 2.5% @@ -19,7 +19,7 @@ void DimmerFcn() { - if (DutyCycle == 0.0) // check if duty cycle is already at minimum + if (DutyCycle <= 0.1) // check if duty cycle is already at minimum {return;} else {DutyCycle = DutyCycle - 0.025;} // lower duty cycle with 2.5%