@@ -82,7 +82,7 @@ def display(self):
8282
8383 while not self .spi_device .try_lock ():
8484 pass
85- self .sram ._cs .value = False
85+ self .sram .cs_pin .value = False
8686 #send read command
8787 self .spi_device .write (bytearray ([Adafruit_MCP_SRAM .SRAM_READ ]))
8888 #send start address
@@ -98,15 +98,15 @@ def display(self):
9898 self ._dc .value = True
9999 xfer = bytearray ([cmd ])
100100 outbuf = bytearray (1 )
101- for i in range (self .bw_bufsize ):
101+ for _ in range (self .bw_bufsize ):
102102 outbuf [0 ] = xfer [0 ]
103103 self .spi_device .write_readinto (outbuf , xfer )
104104 self ._cs .value = True
105- self .sram ._cs .value = True
105+ self .sram .cs_pin .value = True
106106
107107 time .sleep (.002 )
108108
109- self .sram ._cs .value = False
109+ self .sram .cs_pin .value = False
110110 #send read command
111111 self .spi_device .write (bytearray ([Adafruit_MCP_SRAM .SRAM_READ ]))
112112 #send start address
@@ -122,11 +122,11 @@ def display(self):
122122 self ._dc .value = True
123123 xfer = bytearray ([cmd ])
124124 outbuf = bytearray (1 )
125- for i in range (self .bw_bufsize ):
125+ for _ in range (self .bw_bufsize ):
126126 outbuf [0 ] = xfer [0 ]
127127 self .spi_device .write_readinto (outbuf , xfer )
128128 self ._cs .value = True
129- self .sram ._cs .value = True
129+ self .sram .cs_pin .value = True
130130 self .spi_device .unlock ()
131131
132132 self .update ()
@@ -153,19 +153,6 @@ def draw_pixel(self, x, y, color):
153153 self .sram .write8 (addr , current )
154154 return
155155
156- def get_pixel (self , x , y , color ):
157- if (x < 0 ) or (x >= self .width ) or (y < 0 ) or (y >= self .height ):
158- return None
159-
160- if x == 0 :
161- x = 1
162-
163- addr = int (((self .width - x ) * self .height + y )/ 8 )
164- if color == Adafruit_EPD .RED :
165- addr = addr + self .bw_bufsize
166- current = self .sram .read8 (addr )
167- return current
168-
169156 def clear_buffer (self ):
170157 self .sram .erase (0x00 , self .bw_bufsize , 0xFF )
171158 self .sram .erase (self .bw_bufsize , self .red_bufsize , 0xFF )
0 commit comments