Hello , I have built the following code and defined hspi.
I defined buf2[0] but as you can see below i cant send it.
Where di i go wrong sending this variable?
*************************************
import machine
from machine import Pin, SPI
from time import sleep
hspi = SPI(1, baudrate=1000000, polarity=0, phase=0)
#hspi = SPI(1) # sck=14 (scl), mosi=13 (sda), miso=12 (unused)
dc = Pin(4) # data/command
rst = Pin(5) # reset
cs = Pin(15) # chip select, some modules do not have a pin for this
cs.value(0)
cs.value(1)
***********************************************
>>> hspi
HSPI(id=1, baudrate=1000000, polarity=0, phase=0)
>>> buf2[0]
3
>>> hspi.write(buf[0])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: object with buffer protocol required
>>>