Hi guys,
Always thanks for your all support for the micropython!!!
I made some projects using MICROPYTHON already this year even I am a newbie for coding.
At this time, I need to display data on character LCD display made by Newhaven:https://www.digikey.kr/ko/products/deta ... V3/2626390
Here's my sample code.
I think I should know how to make hex data for this display.
Checked the signal on the SPI data and the clock line by an oscilloscope.
PLZ help me..
from pyb import SPI,I2C,UART
import time,os
import pyb
spi1=SPI(1, SPI.CONTROLLER, baudrate=100000, polarity=1, phase=1)
#spi1=SPI(1, SPI.PERIPHERAL, baudrate=100000, polarity=1, phase=1) <- It doesn't work.
spiss=pyb.Pin('X5',pyb.Pin.OUT_PP)
spiss(0)
while True:
com1=0xfe #default
com2=0x42 # command for display on
data=0x00
spi1.send(b'com1,com2')
pyb.delay(1000)
How to send data using SPI for Newhaven character display.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: How to send data using SPI for Newhaven character display.
This line
will send the literal bytes object "com1,com2" which is not what I think you intend. Try
Code: Select all
spi1.send(b'com1,com2')
Code: Select all
spi1.send(b"\xfe\x42")
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: How to send data using SPI for Newhaven character display.
Thanks!!!pythoncoder wrote: ↑Sat Dec 11, 2021 9:52 amThis linewill send the literal bytes object "com1,com2" which is not what I think you intend. TryCode: Select all
spi1.send(b'com1,com2')
Code: Select all
spi1.send(b"\xfe\x42")
Now I can understand all things.