LCD
Dependencies: NOKIA_5110 mbed-src mbed
Fork of Nokia5110_test_nucleo by
main.cpp@2:f2d6f6f31e69, 2015-11-15 (annotated)
- Committer:
- kantapon501
- Date:
- Sun Nov 15 15:43:12 2015 +0000
- Revision:
- 2:f2d6f6f31e69
- Parent:
- 1:8e117fc4a3ac
LCD
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ThihaElectronics | 0:083b72141582 | 1 | #include "mbed.h" |
ThihaElectronics | 0:083b72141582 | 2 | #include "NOKIA_5110.h" |
ThihaElectronics | 0:083b72141582 | 3 | |
ThihaElectronics | 0:083b72141582 | 4 | int main() { |
ThihaElectronics | 0:083b72141582 | 5 | |
c128 | 1:8e117fc4a3ac | 6 | LcdPins myPins; |
c128 | 1:8e117fc4a3ac | 7 | |
c128 | 1:8e117fc4a3ac | 8 | // myPins.sce = PB_6; |
c128 | 1:8e117fc4a3ac | 9 | myPins.sce = PA_9; |
c128 | 1:8e117fc4a3ac | 10 | myPins.rst = PA_6; |
c128 | 1:8e117fc4a3ac | 11 | myPins.dc = PA_8; |
c128 | 1:8e117fc4a3ac | 12 | myPins.mosi = PA_7;//SPI_MOSI; |
c128 | 1:8e117fc4a3ac | 13 | myPins.miso = NC; |
c128 | 1:8e117fc4a3ac | 14 | myPins.sclk = PA_5;//SPI_SCK; |
ThihaElectronics | 0:083b72141582 | 15 | |
c128 | 1:8e117fc4a3ac | 16 | // Start the LCD |
c128 | 1:8e117fc4a3ac | 17 | NokiaLcd myLcd( myPins ); |
c128 | 1:8e117fc4a3ac | 18 | |
ThihaElectronics | 0:083b72141582 | 19 | myLcd.InitLcd(); // LCD is reset and DDRAM is cleared |
ThihaElectronics | 0:083b72141582 | 20 | myLcd.DrawString("Hello"); |
ThihaElectronics | 0:083b72141582 | 21 | while(1) |
ThihaElectronics | 0:083b72141582 | 22 | { }; |
ThihaElectronics | 0:083b72141582 | 23 | } |