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

Dependencies:   TextLCD_ST7565SPI mbed

Committer:
kayekss
Date:
Mon Mar 02 23:12:38 2015 +0000
Revision:
0:895b272c0de6
Initial release.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kayekss 0:895b272c0de6 1 #include "mbed.h"
kayekss 0:895b272c0de6 2 #include "TextLCD_ST7565SPI.h"
kayekss 0:895b272c0de6 3
kayekss 0:895b272c0de6 4 TextLCD_ST7565SPI lcd(/*MOSI*/ p5, /*SCK*/ p7, /*CS*/ p8,
kayekss 0:895b272c0de6 5 /*RS*/ p11, /*RST*/ p12, /*Columns*/ 21, /*Rows*/ 8);
kayekss 0:895b272c0de6 6
kayekss 0:895b272c0de6 7 int main(void) {
kayekss 0:895b272c0de6 8 // Initialize LCD
kayekss 0:895b272c0de6 9 lcd.init(/*V0*/ 3, /*Contrast*/ 48, /*Bias*/ TextLCD_ST7565SPI::Bias1_9);
kayekss 0:895b272c0de6 10
kayekss 0:895b272c0de6 11 lcd.locate(0, 0);
kayekss 0:895b272c0de6 12 lcd.printf("Hello, world");
kayekss 0:895b272c0de6 13
kayekss 0:895b272c0de6 14 uint32_t count = 0;
kayekss 0:895b272c0de6 15 lcd.locate(0, 1);
kayekss 0:895b272c0de6 16 while (1) {
kayekss 0:895b272c0de6 17 lcd.printf("\r\n%d", count++);
kayekss 0:895b272c0de6 18 wait(1);
kayekss 0:895b272c0de6 19 }
kayekss 0:895b272c0de6 20 }