(self, display, icons=None, dim_time=10, ss_time=120, xres=128, yres=64)
| 20 | StateSaver = 2 # Screen saver: only icons at random places on screen. |
| 21 | |
| 22 | def __init__(self, display, icons=None, dim_time=10, ss_time=120, xres=128, yres=64): |
| 23 | self.display = display # Display driver |
| 24 | self.icons = icons |
| 25 | self.lines = [] |
| 26 | self.xres = xres |
| 27 | self.yres = yres |
| 28 | # The framebuffer of MicroPython only supports 8x8 fonts so far, so: |
| 29 | self.select_font("big") |
| 30 | self.last_update = time.time() |
| 31 | # OLED saving system state. We write text at an x,y offset, that |
| 32 | # can be of 0 or 1 pixels. This way we use pixels more evenly |
| 33 | # creating a less evident image ghosting effect in the more |
| 34 | # used pixels. |
| 35 | self.xoff = 0 |
| 36 | self.yoff = 0 |
| 37 | self.dim_t = dim_time # Inactivity to set to lower contrast. |
| 38 | self.screensave_t = ss_time # Inactivity to enable screen saver. |
| 39 | self.state = self.StateActive |
| 40 | self.contrast = 255 |
| 41 | |
| 42 | # Set maximum display contrast. It will be dimmed after some inactivity |
| 43 | # time. |
nothing calls this directly
no test coverage detected