Demo Source Code - StarFive VisionFive SPI User Manual

Table of Contents

Advertisement

4. Demo Source Code

The Python source code of this demo is provided for reference purpose only.
2.4inch_LCD_demo.py:
'''
Please make sure the 2.4inch LCD module is connected to the correct pins.
The following table describes how to connect the 2.4inch LCD Module to the 40-pin header.
-------------------------------------------------
__2.4inch LCD Module___Pin Number_____Pin Name
VCC 17 3.3 V Power
GND 39 GND
DIN 19 SPI MOSI
CLK 23 SPI SCLK
CS 24 SPI CE0
DC 40 GPIO0
RST 11 GPIO44
BL 18 GPIO19
-------------------------------------------------
'''
import
os
import
sys
import
time
import
logging
from
PIL
import
Image
sys.path.append("..")
from
import
lib
LCD2inch4_lib
'''
Demo modification and new function description:
------------------------------------------------------------
I. Add the clear() function to fill LCD screen with white
II. Give a hexadecimal value of white
III. Cycle through multiple pictures
---------------------------------------------------------------
'''
WHITE = 0xFF
def
main():
print('-----------lcd
demo-------------')
#The initialization settings of 2.4inch module.
disp = LCD2inch4_lib.LCD_2inch4(44, 0, '/dev/spidev0.0')
disp.lcd_init_2inch4()
15
© 2018-2022 上海赛昉科技有限公司
版权所有
www.starfivetech.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VisionFive SPI and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents