Jan Zumwalt
Published © GPL3+

Pinguino LCD Adaptable to Other MCU's

A simple method of using a LCD.

IntermediateShowcase (no instructions)530
Pinguino LCD Adaptable to Other MCU's

Things used in this project

Hardware components

Generic LCD
×1
Pinguino compatible board
×1

Software apps and online services

Pinguino IDE

Story

Read more

Code

Code snippet #1

C/C++
/*-----------------------------------------------------
Author:      Jan Zumwalt
Date:        2016-01-12
Hardware:    Olimex Micro Dev board, hd44780 LCD controller
Build:       Pinguino-11 IDE & compiler
Description: and LCD test
-----------------------------------------------------*/

 void setup() {
   int contrast = 31;           // contrast pin
   pinMode(contrast, OUTPUT);
   digitalWrite(contrast,LOW);  // max contrast

   // initialize the library with the numbers of the interface pins
   // lcd.pins(RS, EN, D4, D5, D6, D7, 0, 0, 0, 0);     // 4bit mode
   // lcd.pins(RS, EN, D0, D1, D2, D3, D4, D5, D6, D7); // 8bit mode

   // Place the lcd with the last two ins (power and ground) past 
   // the Olimex Micro board pins, the LCD control pins will
   // match up to this example program.
   lcd.pins(30, 28, 27, 26, 25, 24, 23, 22, 21, 20);    // 8bit mode

   lcd.begin(20, 4);                                    // set col and rows:
   lcd.setCursor(0, 3);                                 // col 0, row 4
   lcd.print("C1,R4 Hello World!");
 }

 void loop() {                                         // col=1 to x, row=0 to x

   lcd.setCursor(3, 1);                                // locate C3,R1                   
   lcd.printf("Pinguino: %d", millis()/1000);          // elapsed secs since power up
   delay(100);
 }

Credits

Jan Zumwalt

Jan Zumwalt

9 projects • 14 followers
Retired aerospace engineer, aviation pilot, mechanic

Comments