Harsha version of uLCD gauges
Dependencies: 4DGL-uLCD-SE mbed uLCD_gauges
main.cpp@1:ed58e196536d, 2015-03-12 (annotated)
- Committer:
- Striker121
- Date:
- Thu Mar 12 18:21:31 2015 +0000
- Revision:
- 1:ed58e196536d
- Parent:
- 0:a51f64464f0a
First revision to give to harsha
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Striker121 | 0:a51f64464f0a | 1 | #include "mbed.h" |
Striker121 | 0:a51f64464f0a | 2 | //#include "uLCD_4DGL.h" //Not needed because it's include in uLCD_gauges. It's lack of a define guard requires it to only be included once. |
Striker121 | 0:a51f64464f0a | 3 | #include "uLCD_gauges.h" |
Striker121 | 0:a51f64464f0a | 4 | |
Striker121 | 0:a51f64464f0a | 5 | uLCD_4DGL uLCD(p9,p10,p11); // serial tx, serial rx, reset pin; |
Striker121 | 0:a51f64464f0a | 6 | uLCD_gauges gauge(uLCD, 1, 90); |
Striker121 | 0:a51f64464f0a | 7 | |
Striker121 | 0:a51f64464f0a | 8 | int main() |
Striker121 | 0:a51f64464f0a | 9 | { |
Striker121 | 0:a51f64464f0a | 10 | /* |
Striker121 | 0:a51f64464f0a | 11 | uLCD.cls(); |
Striker121 | 0:a51f64464f0a | 12 | uLCD.media_init(); |
Striker121 | 0:a51f64464f0a | 13 | uLCD.set_sector_address(0,0); |
Striker121 | 0:a51f64464f0a | 14 | */ |
Striker121 | 0:a51f64464f0a | 15 | gauge.start(); |
Striker121 | 0:a51f64464f0a | 16 | int i = 1; |
Striker121 | 0:a51f64464f0a | 17 | // Now make a class that lets you setup the gauge. Make it take a pointer to the uLCD instance? |
Striker121 | 0:a51f64464f0a | 18 | while (1) { |
Striker121 | 0:a51f64464f0a | 19 | if(i == 0) i = 1; |
Striker121 | 0:a51f64464f0a | 20 | //uLCD.display_frame(0,0,i); |
Striker121 | 0:a51f64464f0a | 21 | gauge.update(float(i)); |
Striker121 | 0:a51f64464f0a | 22 | wait(0.05); |
Striker121 | 0:a51f64464f0a | 23 | i++; |
Striker121 | 0:a51f64464f0a | 24 | i = i%90; |
Striker121 | 0:a51f64464f0a | 25 | } |
Striker121 | 0:a51f64464f0a | 26 | |
Striker121 | 0:a51f64464f0a | 27 | } |