constant.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # LCD TYPES
  2. I2CBAUDRATE=100000
  3. I2C128x32 = {'width': 128, 'height': 32}
  4. I2C128x64 = {'width': 128, 'height': 64}
  5. # LCD Control constants
  6. SSD1306_I2C_ADDRESS = 0x3C
  7. SSD1306_SETCONTRAST = 0x81
  8. SSD1306_DISPLAYALLON_RESUME = 0xA4
  9. SSD1306_DISPLAYALLON = 0xA5
  10. SSD1306_NORMALDISPLAY = 0xA6
  11. SSD1306_INVERTDISPLAY = 0xA7
  12. SSD1306_DISPLAYOFF = 0xAE
  13. SSD1306_DISPLAYON = 0xAF
  14. SSD1306_SETDISPLAYOFFSET = 0xD3
  15. SSD1306_SETCOMPINS = 0xDA
  16. SSD1306_SETVCOMDETECT = 0xDB
  17. SSD1306_SETDISPLAYCLOCKDIV = 0xD5
  18. SSD1306_SETPRECHARGE = 0xD9
  19. SSD1306_SETMULTIPLEX = 0xA8
  20. SSD1306_SETLOWCOLUMN = 0x00
  21. SSD1306_SETHIGHCOLUMN = 0x10
  22. SSD1306_SETSTARTLINE = 0x40
  23. SSD1306_MEMORYMODE = 0x20
  24. SSD1306_COLUMNADDR = 0x21
  25. SSD1306_PAGEADDR = 0x22
  26. SSD1306_COMSCANINC = 0xC0
  27. SSD1306_COMSCANDEC = 0xC8
  28. SSD1306_SEGREMAP = 0xA0
  29. SSD1306_CHARGEPUMP = 0x8D
  30. SSD1306_EXTERNALVCC = 0x1
  31. SSD1306_SWITCHCAPVCC = 0x2
  32. # Scrolling constants
  33. SSD1306_ACTIVATE_SCROLL = 0x2F
  34. SSD1306_DEACTIVATE_SCROLL = 0x2E
  35. SSD1306_SET_VERTICAL_SCROLL_AREA = 0xA3
  36. SSD1306_RIGHT_HORIZONTAL_SCROLL = 0x26
  37. SSD1306_LEFT_HORIZONTAL_SCROLL = 0x27
  38. SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL = 0x29
  39. SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2A