TS7-Pro 7-inch Touch Screen
the data type of the transferred content (
'numeric'
is a numeric type,
'string'
is a string type,
'bool'
is a
boolean type, and
'location'
is a list containing two dictionaries).
Through the analysis of the
variables
dictionary, we can know that Cloud4RPi will read the keys of the
variables
dictionary and display the value corresponding to the key in the Control Panel. Obviously we can-
not change the keys of the
variables
dictionary, but we can change the value in the key (the value of the
'bind'
dictionary) to let the widgets display the content we want.
For example, if we want to send humidity values to Cloud4RPi, we cannot add a new key to the
variables
dictio-
nary, but we can borrow a key, such as the
'Room Temp'
key, and then write the function that returns the humidity
value in the corresponding
'bind'
key.
variables
=
{
'Room Temp'
: {
'type'
:
'numeric'
if
ds_sensors
else
'string'
,
'bind'
: ds_sensors[
0
]
if
ds_sensors
else
sensor_not_connected
},
'LED On'
: {
'type'
:
'bool'
,
'value'
:
False
,
'bind'
: led_control
},
'CPU Temp'
: {
'type'
:
'numeric'
,
'bind'
: rpi
.
cpu_temp
},
'STATUS'
: {
'type'
:
'string'
,
'bind'
: listen_for_events
},
'Location'
: {
'type'
:
'location'
,
'bind'
: get_location
}
The
vdiagnostics
stores information about the Raspberry Pi and is used to verify and prevent misconnections.
vdiagnostics
=
{
'CPU Temp'
: rpi
.
cpu_temp,
'IP Address'
: rpi
.
ip_address,
'Host'
: rpi
.
host_name,
'Operating System'
: rpi
.
os_name,
'Client Version:'
: cloud4rpi
.
__version__,
}
5.5.3 Projects
In this section, you will start learning to create IoT projects.
Before starting the project, you should have downloaded the code we provided.
Open a Terminal and enter the following command to download them from github.
git clone https://github.com/sunfounder/ts7-pro
Then copy the codes from the
iot
folder to the
cloud4rpi-raspberrypi-python
folder.
5.5. Cloud4RPi
109
Содержание TS7-Pro
Страница 1: ...TS7 Pro 7 inch Touch Screen www sunfounder com Jun 30 2022 ...
Страница 2: ......
Страница 4: ...8 Copyright Notice 231 ii ...
Страница 6: ...TS7 Pro 7 inch Touch Screen 2 CONTENTS ...
Страница 10: ...TS7 Pro 7 inch Touch Screen 6 Chapter 1 HARDWARE INTRODUCTION ...
Страница 12: ...TS7 Pro 7 inch Touch Screen 8 Chapter 2 ASSEMBLY INSTRUCTIONS ...
Страница 32: ...TS7 Pro 7 inch Touch Screen 28 Chapter 3 QUICK USER GUIDE ...
Страница 36: ...TS7 Pro 7 inch Touch Screen 3 Put the Protective Cover Plate back on 32 Chapter 4 ADDING PERIPHERAL DEVICES ...
Страница 40: ...TS7 Pro 7 inch Touch Screen 36 Chapter 4 ADDING PERIPHERAL DEVICES ...
Страница 56: ...TS7 Pro 7 inch Touch Screen 3 Insert the USB Bridge 52 Chapter 4 ADDING PERIPHERAL DEVICES ...
Страница 59: ...TS7 Pro 7 inch Touch Screen 4 6 Using as Extension Screen for PC 55 ...
Страница 60: ...TS7 Pro 7 inch Touch Screen 56 Chapter 4 ADDING PERIPHERAL DEVICES ...
Страница 85: ...TS7 Pro 7 inch Touch Screen Select the device type ESP32 for example 5 4 Home Assistant 81 ...
Страница 93: ...TS7 Pro 7 inch Touch Screen 3 Select the content you want to share to Home Assistant 5 4 Home Assistant 89 ...
Страница 135: ...TS7 Pro 7 inch Touch Screen 5 7 Scratch Projects 131 ...
Страница 147: ...TS7 Pro 7 inch Touch Screen Add the Banana sprite and adjust the angle 5 7 Scratch Projects 143 ...
Страница 148: ...TS7 Pro 7 inch Touch Screen Also let it appear at the right time 144 Chapter 5 PROJECTS AND ACTIVITIES ...
Страница 151: ...TS7 Pro 7 inch Touch Screen 5 7 Scratch Projects 147 ...
Страница 155: ...TS7 Pro 7 inch Touch Screen Set the balloon to a random position 5 7 Scratch Projects 151 ...
Страница 156: ...TS7 Pro 7 inch Touch Screen Let it change the color and size randomly 152 Chapter 5 PROJECTS AND ACTIVITIES ...
Страница 161: ...TS7 Pro 7 inch Touch Screen 5 7 Scratch Projects 157 ...
Страница 162: ...TS7 Pro 7 inch Touch Screen 158 Chapter 5 PROJECTS AND ACTIVITIES ...
Страница 167: ...TS7 Pro 7 inch Touch Screen 5 7 Scratch Projects 163 ...
Страница 180: ...TS7 Pro 7 inch Touch Screen 176 Chapter 5 PROJECTS AND ACTIVITIES ...
Страница 186: ...TS7 Pro 7 inch Touch Screen Copy out the second Trees 182 Chapter 5 PROJECTS AND ACTIVITIES ...
Страница 187: ...TS7 Pro 7 inch Touch Screen 5 7 Scratch Projects 183 ...
Страница 193: ...TS7 Pro 7 inch Touch Screen 5 7 Scratch Projects 189 ...
Страница 197: ...TS7 Pro 7 inch Touch Screen Then we add the Pen extension function 5 7 Scratch Projects 193 ...
Страница 207: ...TS7 Pro 7 inch Touch Screen 5 7 Scratch Projects 203 ...
Страница 209: ...TS7 Pro 7 inch Touch Screen 5 7 Scratch Projects 205 ...
Страница 234: ...TS7 Pro 7 inch Touch Screen 230 Chapter 7 FAQ ...