Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD_ON = 175
- CMD_OFF = 174
- CMD_CHARGE_PUMP_SET = 141
- CMD_SET_ROW = 176
- CMD_TOP_TO_BOTTOM = 200
- CMD_LEFT_TO_RIGHT = 161
- CMD_SET_ADDR_MODE = 32
- ADDR_MODE_HORIZ = 0b00
- CHARGE_PUMP_ON = 20
- CMD_BUF = bytearray(1)
- def command(*cmds):
- for cmd in cmds:
- CMD_BUF[0] = cmd
- i2c.write(60, CMD_BUF, prefix=128)
- def display_init():
- i2c.init(1000000)
- command(CMD_OFF)
- sleep(10)
- command(CMD_ON)
- command(CMD_TOP_TO_BOTTOM, CMD_LEFT_TO_RIGHT)
- sleep(10)
- command(CMD_SET_ADDR_MODE, ADDR_MODE_HORIZ)
- command(0x21, 0, 127)
- command(CMD_CHARGE_PUMP_SET, CHARGE_PUMP_ON)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement