background image

www.joy

-

it.net

 

Pascalstr. 8 47506 Neukirchen

-

Vluyn

 

 

 

There you activate SPI under 

5  Interfacing  Options 

→ 

P4  SPI

. Then run 

the  following  command  to  restart  the  Raspberry  Pi  to  put  the  changes 

into effect.

 

sudo reboot

 

For this code example we use the library 

RPI  ST7789

which was publis-

hed under the 

MIT Lizenz

To do this, insert the following commands one 

after the other to successfully install the library.

 

sudo apt

-

get update

 

sudo  apt

-

get  install  python3

-

rpi.gpio  python3

-

spidev  python3

-

pip  python3

-

pil 

python3

-

numpy

 

git clone https://github.com/rusconi/Rpi

-

ST7789.git

 

cd Rpi

-

ST7789

 

sudo python3 setup.py install

 

Now  you  have  successfully  downloaded  the  library.  You  can  download 

the sample code 

here

 

or use the following command to download it di-

rectly to your Raspberry Pi. 

 

wget https://joy

-

it.net/files/files/Produkte/SBC

-

LCD01/SBC

-

LCD01

-

Python.zip

 

You must download this file to have the image file on your Raspberry Pi.  

Now you can execute the following commands to project the image file 

on your LCD.

 

unzip SBC

-

LCD01

-

Python

 

cd SBC

-

LCD01

-

Python

 

sudo python3 image.py Joy

-

IT

-

240x240.png

 

In the following you will additionally find our code:

 

 

import

 sys

 

from

 PIL 

import

 Image

 

import

 ST7789 

as

 ST7789

 

 

# Save image from argument

 

picRAW 

=

 sys

.

argv

[

1

]

 

# Declare display

 

lcd 

=

 ST7789

.

ST7789

(

 port

=

 

0

,

 

 

 

cs 

=

 ST7789

.

BG_SPI_CS_FRONT

,

 

 

 

dc 

=

 

25

,

 rst 

=

 

27

,

 backlight 

=

 

18

,

 

 

 

mode 

=

 

3

,

 spi_speed_hz 

=

 

8000000

)

 

 

lcd

.

begin

()

 

# Open image

 

pic 

=

 Image

.

open

(

picRAW

)

 

# Fit image to screen

 

pic 

=

 pic

.

resize

((

lcd

.

width

,

 lcd

.

height

))

 

# Show image on display

 

lcd

.

display

(

pic

)

 

Summary of Contents for SBC-LCD01

Page 1: ...ENERAL INFORMATION Dear customer thank you for choosing our product In the following we will show you how to use this device Should you encounter any unexpected problems during use please do not hesit...

Page 2: ...uino IDE There you go to the library manager which you can find under Sketch Include library Manage libraries There you install Adafruit ST7735 and ST7789 Library and the Adafruit GFX Library using th...

Page 3: ...laration of Data Command Pin define RST 4 Declaration of RESET Pin Initialize display Adafruit_ST7789 lcd Adafruit_ST7789 CS DC RST void setup void lcd init 240 240 SPI_MODE2 lcd setRotation 1 delay 5...

Page 4: ...ES Pin 23 SCLK SCL Pin 19 MOSI SDA GND GND 3 3 V VCC Pin 12 GPIO 18 BLK 2 Code example with SPI We offer you two sample codes for the Raspberry Pi One is a control via SPI and the other one via a fram...

Page 5: ...e library You can download the sample code here or use the following command to download it di rectly to your Raspberry Pi wget https joy it net files files Produkte SBC LCD01 SBC LCD01 Python zip You...

Page 6: ...41 by executing the following commands one after the other sudo apt get install cmake cd git clone clone https github com juj fbcp ili9341 git cd fbcp ili3941 mkdir build You must edit the display h b...

Page 7: ...ew product in normal household quantities Possibility of restitution at our company location during our opening hours Simac GmbH Pascalstr 8 D 47506 Neukirchen Vluyn Possibility of restitution nearby...

Reviews: