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.
Dependencies: 4DGL-uLCD-SE mbed
LCDControl.cpp@5:63d34be8ebf6, 2015-10-16 (annotated)
- Committer:
- rproctor6
- Date:
- Fri Oct 16 19:34:35 2015 +0000
- Revision:
- 5:63d34be8ebf6
- Parent:
- 3:d30ae8ff30bf
LCDControl
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kevinrhyne | 2:03181ee070d3 | 1 | //import LCD stuff |
rproctor6 | 5:63d34be8ebf6 | 2 | #include "mbed.h" |
rproctor6 | 5:63d34be8ebf6 | 3 | #include "uLCD_4DGL.h" |
kevinrhyne | 2:03181ee070d3 | 4 | |
rproctor6 | 5:63d34be8ebf6 | 5 | uLCD_4DGL uLCD(p9,p10,p8); // serial tx, serial rx, reset pin; |
kevinrhyne | 2:03181ee070d3 | 6 | |
kevinrhyne | 2:03181ee070d3 | 7 | class LCDControl{ |
rproctor6 | 5:63d34be8ebf6 | 8 | int strength; |
rproctor6 | 5:63d34be8ebf6 | 9 | bool mode; |
rproctor6 | 5:63d34be8ebf6 | 10 | public: |
rproctor6 | 5:63d34be8ebf6 | 11 | void update(int, bool); |
rproctor6 | 5:63d34be8ebf6 | 12 | void printStrength(int); |
rproctor6 | 5:63d34be8ebf6 | 13 | }; |
kevinrhyne | 2:03181ee070d3 | 14 | |
rproctor6 | 5:63d34be8ebf6 | 15 | void LCDControl::update(int x, bool y) { //do update stuff on LCD |
rproctor6 | 5:63d34be8ebf6 | 16 | strength = x; |
rproctor6 | 5:63d34be8ebf6 | 17 | mode = y; |
rproctor6 | 5:63d34be8ebf6 | 18 | printStrength(strength); |
rproctor6 | 5:63d34be8ebf6 | 19 | } |
rproctor6 | 5:63d34be8ebf6 | 20 | |
rproctor6 | 5:63d34be8ebf6 | 21 | void LCDControl::printStrength(int x) { |
rproctor6 | 5:63d34be8ebf6 | 22 | uLCD.cls(); |
rproctor6 | 5:63d34be8ebf6 | 23 | uLCD.printf("Signal Strenght: %d", x); |
rproctor6 | 5:63d34be8ebf6 | 24 | } |
rproctor6 | 5:63d34be8ebf6 | 25 |