Print to LCD
Dependencies: DOGS102 mbed-rtos mbed
Fork of MTDOT_BOX_EVB_Blinky by
main.cpp@14:95709e8d776a, 2016-04-04 (annotated)
- Committer:
- maclobdell
- Date:
- Mon Apr 04 18:52:55 2016 +0000
- Revision:
- 14:95709e8d776a
- Parent:
- 13:142a8d831f29
initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dan | 0:7dec7e9ac085 | 1 | #include "mbed.h" |
maclobdell | 12:d41bdc50f852 | 2 | #include "rtos.h" |
maclobdell | 14:95709e8d776a | 3 | #include "DOGS102.h" |
maclobdell | 14:95709e8d776a | 4 | #include "font_6x8.h" |
dan | 0:7dec7e9ac085 | 5 | |
maclobdell | 13:142a8d831f29 | 6 | Serial debug(USBTX, USBRX); |
maclobdell | 14:95709e8d776a | 7 | SPI lcd_spi(SPI1_MOSI, SPI1_MISO, SPI1_SCK); |
maclobdell | 14:95709e8d776a | 8 | DigitalOut lcd_spi_cs(SPI1_CS, 1); |
maclobdell | 14:95709e8d776a | 9 | DigitalOut lcd_cd(XBEE_ON_SLEEP, 1); |
maclobdell | 14:95709e8d776a | 10 | DOGS102* lcd; |
maclobdell | 12:d41bdc50f852 | 11 | |
dan | 0:7dec7e9ac085 | 12 | int main() { |
maclobdell | 12:d41bdc50f852 | 13 | |
maclobdell | 14:95709e8d776a | 14 | char buffer[32]; |
maclobdell | 14:95709e8d776a | 15 | |
maclobdell | 13:142a8d831f29 | 16 | |
maclobdell | 14:95709e8d776a | 17 | lcd = new DOGS102(lcd_spi, lcd_spi_cs, lcd_cd); |
maclobdell | 14:95709e8d776a | 18 | sprintf(buffer, " Hello World! "); |
maclobdell | 14:95709e8d776a | 19 | lcd->writeText(6, 1, font_6x8, buffer, strlen(buffer)); |
maclobdell | 14:95709e8d776a | 20 | |
maclobdell | 14:95709e8d776a | 21 | |
dan | 0:7dec7e9ac085 | 22 | } |