Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 2:b57e33335e5e, committed 2020-01-11
- 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 |
--- 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); }