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.
Fork of N5110 by
Revision 20:b921d8c99714, committed 2016-05-04
- Comitter:
- JAC__RICHARDS
- Date:
- Wed May 04 19:36:52 2016 +0000
- Parent:
- 19:ba8addc061ea
- Commit message:
- before main function try
Changed in this revision
N5110.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/N5110.cpp Thu Apr 23 18:57:52 2015 +0000 +++ b/N5110.cpp Wed May 04 19:36:52 2016 +0000 @@ -90,9 +90,9 @@ void N5110::setBrightness(float brightness) { // check whether brightness is within range - if (brightness < 0.0) + if (brightness < 0) brightness = 0.0; - if (brightness > 1.0) + if (brightness > 1) brightness = 1.0; // set PWM duty cycle led->write(brightness); @@ -291,7 +291,7 @@ // elements are normalised from 0.0 to 1.0, so multiply // by 47 to convert to pixel range, and subtract from 47 // since top-left is 0,0 in the display geometry - setPixel(i,47 - int(array[i]*47.0)); + setPixel(i,47 - int(array[i]*47)); } refresh();