Giter VIP home page Giter VIP logo

doglcd's Introduction

Note

This library is unmaintained and obsolete, you should probably use our ST7036 Driver instead, which you can find here: https://github.com/pimoroni/st7036

DOG LCD Python for Raspberry Pi

Special thanks to Eberhard Fahle who created the Arduino DogLcd library which I have ported to create this module.

Intro

This library supports the DOGM081E, DOGM163E and DOGM183E displays with ST7036 driver IC over the 4-wire SPI serial interface ( SI: Serial Input, CLK: Clock, RS: Register-Select and CSB: Chip-Select ).

You must connect at least SI, CLK and RS but can add multiple displays using an extra pin for each CSB.

Refer to the DOG LCD datasheet for details on wiring and support components for 3.3v SPI.

http://www.lcd-module.com/eng/pdf/doma/dog-me.pdf

Note: This library has only been tested against the DOGM163E-A

Getting Started

Install the doglcd module and use as follows:

import doglcd

CONTRAST = 0x28

lcd = doglcd.DogLCD(SI, CLK, RS, CSB, RESET, BACKLIGHT)
lcd.begin(doglcd.DOG_LCD_M163, CONTRAST)

lcd.clear()
lcd.home()

lcd.write('Hello World!')

Usage

These are the doglcd functions you can use, anything not listed here may have unexpected results

reset()

Reset the LCD

clear()

Clear the LCD

home()

Relocate cursor to 0,0

noCursor() / cursor()

Turn the cursor off / on

noDisplay() / display()

Turn the display off / on

noBlink() / blink()

Turn blinking cursor off / on

scrollDisplayLeft() / scrollDisplayRight()

Manually scroll the display 1 character to the left or right

autoScroll() / noAutoscroll()

Toggles on / off automatic scrolling

createChar(index,arr_char)

Create a new char at index ( 0 to 7 ) using an array of 8 5-bit numbers ( 0 to 31 )

Empty char: [0,0,0,0,0,0,0,0]

Full char: [31,31,31,31,31,31,31,31]

rightToLeft() / leftToRight()

Change text direction

writeChar(int)

Write a valid single char from 0 to 255

write(string/int)

Write a string or number to the LCD

Hardware setup

DOG LCD Data Pinout

TOP LEFT

  • 40 : RST, Reset : Pull to VCC
  • 39 : RS, Register Select ( Low = Command / High = Data ) -> Pi
  • 38 : CSB, Chip Select -> Pi
  • 37 : RW ( Low = Write / High = Read ) : Pull to GND
  • 36 : E, Enable : Pull to VCC
  • 35 : D0 : Pull to VCC
  • 34 : D1 : Pull to VCC
  • 33 : D2 : Pull to VCC
  • 32 : D3 : Pull to VCC
  • 31 : D4 : Pull to VCC
  • 30 : D5 : Pull to VCC
  • 29 : D6 : CLK, Clock -> Pi
  • 28 : D7 : SI, Serial Input -> Pi
  • 27 : GND
  • 26 : VCC
  • 25 : Voltage Booster IN : Pull to VCC
  • 24 : Voltage Booster OUT : Bridge to 25 with 0.1uF Cap
  • 23 : PSB ( Low = Serial / High = Parallel ) : Pull to GND
  • 22 : Voltage Booster +
  • 21 : Voltage Booster - : Bridge to 22 with 0.1uF Cap

doglcd's People

Contributors

gadgetoid avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.