Cryosim
Posts: 2
Joined: Mon Apr 02, 2018 2:08 pm

LCD2004-hd44780 big clock?

Thu Jul 23, 2020 9:43 am

Hi! I draw big font on python, who can share code python, how build clock 2x2?
There code:

Code: Select all

!/usr/bin/env python -*- coding: utf-8 -*-
import sys
sys.path.append("/home/pi/weather/lib")

import RPi_I2C_driver
from time import *

mylcd = RPi_I2C_driver.lcd()

mylcd.lcd_clear()

fontdata1 = [
        # Char 0 - Up
        [ 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ],
        # Char 1 - Down
        [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ],
        # Char 2 - Right
        [ 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 ],
        # Char 3 - Left
        [ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18 ],
        # Char 4 - Up-Right
        [ 0x1E, 0x1F, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 ],
        # Char 5 - Up-Left
        [ 0x0F, 0x1F, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18 ],
        # Char 6 - Down-Right
        [ 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x1F, 0x1E ],
        # Char 7 - Down-Left
        [ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x0E ]
]

mylcd.lcd_load_custom_chars(fontdata1)

block = chr(255) # block character, built-in

mylcd.lcd_write(0x80)
mylcd.lcd_write_char(4)
mylcd.lcd_write_char(3)
mylcd.lcd_write(0xC0)
mylcd.lcd_write_char(6)
mylcd.lcd_write_char(7)

Return to “Troubleshooting”