fix python demo
This commit is contained in:
parent
773eba0e26
commit
96f7f571d6
31 changed files with 173 additions and 33 deletions
|
|
@ -100,6 +100,7 @@ class EPD:
|
|||
self.reset_pin = epdconfig.RST_PIN
|
||||
self.dc_pin = epdconfig.DC_PIN
|
||||
self.busy_pin = epdconfig.BUSY_PIN
|
||||
self.cs_pin = epdconfig.CS_PIN
|
||||
self.width = EPD_WIDTH
|
||||
self.height = EPD_HEIGHT
|
||||
|
||||
|
|
@ -159,12 +160,16 @@ class EPD:
|
|||
epdconfig.delay_ms(200)
|
||||
|
||||
def send_command(self, command):
|
||||
epdconfig.digital_write(self.dc_pin, GPIO.LOW)
|
||||
epdconfig.digital_write(self.cs_pin, GPIO.LOW)
|
||||
epdconfig.digital_write(self.dc_pin, GPIO.HIGH)
|
||||
epdconfig.spi_writebyte([command])
|
||||
epdconfig.digital_write(self.cs_pin, GPIO.HIGH)
|
||||
|
||||
def send_data(self, data):
|
||||
epdconfig.digital_write(self.cs_pin, GPIO.LOW)
|
||||
epdconfig.digital_write(self.dc_pin, GPIO.HIGH)
|
||||
epdconfig.spi_writebyte([data])
|
||||
epdconfig.digital_write(self.cs_pin, GPIO.HIGH)
|
||||
|
||||
def wait_until_idle(self):
|
||||
while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue