Example of library TextLCD_ST7565SPI: Text console library for ST7565 graphics LCD controller over SPI interface.

Dependencies:   TextLCD_ST7565SPI mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "TextLCD_ST7565SPI.h"
00003 
00004 TextLCD_ST7565SPI lcd(/*MOSI*/ p5, /*SCK*/ p7, /*CS*/ p8,
00005                       /*RS*/ p11, /*RST*/ p12, /*Columns*/ 21, /*Rows*/ 8);
00006 
00007 int main(void) {
00008     // Initialize LCD
00009     lcd.init(/*V0*/ 3, /*Contrast*/ 48, /*Bias*/ TextLCD_ST7565SPI::Bias1_9);
00010     
00011     lcd.locate(0, 0);
00012     lcd.printf("Hello, world");
00013     
00014     uint32_t count = 0;
00015     lcd.locate(0, 1);
00016     while (1) {
00017         lcd.printf("\r\n%d", count++);
00018         wait(1);
00019     }
00020 }