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.
Diff: N5110.cpp
- Revision:
- 47:2eb1a863ebed
- Parent:
- 46:6de3ebf5b195
- Child:
- 49:93355c01e261
diff -r 6de3ebf5b195 -r 2eb1a863ebed N5110.cpp
--- a/N5110.cpp Mon Nov 27 15:21:36 2017 +0000
+++ b/N5110.cpp Wed Dec 20 13:51:38 2017 +0000
@@ -128,13 +128,13 @@
void N5110::setContrast(float contrast) {
// enforce limits
- if (contrast > 1.0)
- contrast = 1.0;
- else if (contrast < 0.0)
+ if (contrast > 1.0f)
+ contrast = 1.0f;
+ else if (contrast < 0.0f)
contrast = 0.0;
// convert to char in range 0 to 127 (i.e. 6 bits)
- char ic = char(contrast*127.0);
+ char ic = char(contrast*127.0f);
sendCommand(0b00100001); // extended instruction set
sendCommand(0b10000000 | ic); // set Vop (which controls contrast)