SunFounder TS7-Pro Manual

7-inch touch screen

Advertisement

TS7-Pro 7-inch Touch Screen
www.sunfounder.com
Jun 30, 2022

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TS7-Pro and is the answer not in the manual?

Questions and answers

Алексей
June 1, 2025

Нет звука

1 comments:
Mr. Anderson
June 1, 2025

There may be no sound on the SunFounder TS7-Pro for the following reasons:

1. The audio output mode may be incorrect. Analog mode is for headphones, and HDMI mode is for speakers.
2. The speaker wires may not be well connected.
3. The volume level may be too low; adjust it using the buttons on the driver board.

If these steps do not resolve the issue, contact support.

This answer is automatically generated

Subscribe to Our Youtube Channel

Summary of Contents for SunFounder TS7-Pro

  • Page 1 TS7-Pro 7-inch Touch Screen www.sunfounder.com Jun 30, 2022...
  • Page 3: Table Of Contents

    CONTENTS 1 HARDWARE INTRODUCTION 2 ASSEMBLY INSTRUCTIONS 3 QUICK USER GUIDE Install the Raspberry Pi OS ........Adjust the Resolution .
  • Page 4 8 Copyright Notice...
  • Page 5 TS7-Pro 7-inch Touch Screen Introduction This is a 7-inch touch screen with dual-channel speakers and protective cover and stand. High definition display with comfortable viewing angle and good handheld experience. The onboard buttons can be used to adjust the volume and brightness, as well as turn on/off the screen.
  • Page 6 TS7-Pro 7-inch Touch Screen CONTENTS...
  • Page 7: Hardware Introduction

    CHAPTER HARDWARE INTRODUCTION Features • Screen Size: 7 inch Display • Resolution: 1024×600 Pixels • Working Voltage: DC 5V • Rated Power: 3.5W • Touch Screen: 5 dot touch control applies to it, plug and play. • Refresh rate: 60Hz •...
  • Page 8 TS7-Pro 7-inch Touch Screen • Power Used to provide power to this screen when you use it as an extended screen. • Touch(External) When you use this screen as an external screen, you can connect this screen to your device with a micro USB cable.
  • Page 9 TS7-Pro 7-inch Touch Screen Working Sleep Menu Volume Adjust Brightness Adjust Power Enter Sleep state Enter Working Enter Sleep Enter Sleep Enter Sleep state state state state Menu Open the Menu Confirm “+” Increase Volume “+” Increase Vol- Increase Bright- ness “-“...
  • Page 10 TS7-Pro 7-inch Touch Screen Chapter 1. HARDWARE INTRODUCTION...
  • Page 11: Assembly Instructions

    CHAPTER ASSEMBLY INSTRUCTIONS You need to check whether there are missing or damaged components according to the list first. If there are any problems, please contact us and we will solve them as soon as possible. Please follow the steps on the PDF to assemble. •...
  • Page 12 TS7-Pro 7-inch Touch Screen Chapter 2. ASSEMBLY INSTRUCTIONS...
  • Page 13: Quick User Guide

    CHAPTER THREE QUICK USER GUIDE This chapter includes installing the Raspberry Pi OS, installing the virtual keyboard, setting the right-click function and calibrating the rotating screen function. 3.1 Install the Raspberry Pi OS An operating system needs to be installed onto the Micro SD card before inserting it into the Raspberry Pi. Note: Skip this chapter if the Raspberry Pi already has an operating system installed.
  • Page 14 TS7-Pro 7-inch Touch Screen Insert the Micro SD card into the computer or laptop’s SD card slot. If the computer or laptop only has a full-size port for SD cards, use a Micro SD card adapter. Warning: Upgrading the Raspberry Pi OS to Debian Bullseye will cause some features to not work, so it is recommended to continue using the Debian Buster version.
  • Page 15 TS7-Pro 7-inch Touch Screen Select the SD card you are using. Click the WRITE button. 3.1. Install the Raspberry Pi OS...
  • Page 16 TS7-Pro 7-inch Touch Screen The Imager will overwrite any files already on the SD card. If the SD card has any files, back up these files before clicking Yes. After the Imager completes installing the Operating System on the SD card, click Continue to complete the installation.
  • Page 17: Adjust The Resolution

    TS7-Pro 7-inch Touch Screen Now insert the Micro SD card with the system installed into the Raspberry Pi. 3.2 Adjust the Resolution For the Raspberry Pi 3 and the lower versions, you need reset the resolution ratio as follows. As for Raspberry Pi 4, when you start up it, the resolution is optimum.
  • Page 18 TS7-Pro 7-inch Touch Screen (continued from previous page) ..hdmi_drive=2 hdmi_group=2 means DMT (Display Monitor Timings, the standard typically used on monitors) hdmi_mode=87 in- dicates we create a new hdmi mode named 87. hdmi_drive=2 selects the Normal HDMI mode. After the modification is done, save and exit. For more details about configuring config.txt, refer to Raspberry Pi official website: https://www.raspberrypi.org/documentation/configuration/config-txt.md.
  • Page 19 TS7-Pro 7-inch Touch Screen 2) Then choose Configure -> Screens -> HDMI-1 -> Resolution -> choose the resolution that you want. 3.2. Adjust the Resolution...
  • Page 20 TS7-Pro 7-inch Touch Screen 3) After that you need to click the tick icon to save your configure. Chapter 3. QUICK USER GUIDE...
  • Page 21: Install Virtual Keyboard On Raspberry Pi

    TS7-Pro 7-inch Touch Screen 3.3 Install Virtual Keyboard on Raspberry Pi When you use a touch panel, you can connect an external keyboard to help you do a text input operation, but it is best to install a virtual keyboard.
  • Page 22 TS7-Pro 7-inch Touch Screen In the Window option, check Dock to screen edge. And in Auto-show option, check Auto-show when editing text again. Chapter 3. QUICK USER GUIDE...
  • Page 23 TS7-Pro 7-inch Touch Screen The next 2 items are optional, the ones checked in the picture are recommended by us, you can also check other ones. In Layout option, Small is recommanded. In Theme option, DarkRoom is recommanded. 3.3. Install Virtual Keyboard on Raspberry Pi...
  • Page 24 TS7-Pro 7-inch Touch Screen After the setting is complete, restart Raspberry pi. Every time you restart Raspberry pi, you need to click General Access -> Onboard to enable the virtual keyboard. Chapter 3. QUICK USER GUIDE...
  • Page 25 TS7-Pro 7-inch Touch Screen Now you can use this keyboard to edit your files or codes. 3.3. Install Virtual Keyboard on Raspberry Pi...
  • Page 26: Right Click On Raspberry Pi

    TS7-Pro 7-inch Touch Screen 3.4 Right Click on Raspberry Pi The touchscreen makes it easy to perform simple navigation tasks with your finger or stylus, but you may want to be able to use the context menu (right-click menu). Then you will need to download a Touchégg. Enter the following command to install it.
  • Page 27: Rotate The Display And Touch Angle

    TS7-Pro 7-inch Touch Screen Note: The product is not compatible with some of Touchégg’s gestures, such as three-finger zoom in/out. 3.5 Rotate the Display and Touch Angle After the Raspberry Pi is turned on, if you find that the display or touch angle is not correct, or you need to rotate to other angles during use, you can follow the tutorial below to achieve them.
  • Page 28 TS7-Pro 7-inch Touch Screen Then click Configure -> Screens -> HDMI-1 -> Orientation, then select the angle you want to rotate. Chapter 3. QUICK USER GUIDE...
  • Page 29 TS7-Pro 7-inch Touch Screen Click the green checkbox to take effect. Note: • After checking the box, you need to confirm the changes by clicking OK within 10 seconds, otherwise it will go back to the previous angle. 3.5. Rotate the Display and Touch Angle...
  • Page 30 TS7-Pro 7-inch Touch Screen • For Debian Bullseye system, there is only one option - Inverted, if you want to rotate to another angle, you need to set it from command line. 2. Using the Command Line To make this change stay after a reboot, do the following to rotate your display.
  • Page 31 TS7-Pro 7-inch Touch Screen • 0 degrees: Option "CalibrationMatrix" "1 0 0 0 1 0 0 0 1" • 90 degrees: Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1" • 180 degrees: Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"...
  • Page 32 TS7-Pro 7-inch Touch Screen Chapter 3. QUICK USER GUIDE...
  • Page 33: Adding Peripheral Devices

    The 40pin interface is also reserved, so you can connect 40pin cable or connect sensors directly to ensure the scalability of Raspberry Pi. 4.1 Powered by PiPower Required Components • TS7-Pro Screen • PiPower + 2 18650 batteries (self-provided) • Raspberry Pi (Self-provided)
  • Page 34 TS7-Pro 7-inch Touch Screen Mount the PiPower If you buy our PiPower, you can use it to power the TS7-Pro screen directly, so you can easily get it for outdoor use. The specific installation tutorial is as follows. 1. Remove the Protective Cover Plate.
  • Page 35 TS7-Pro 7-inch Touch Screen 2. Secure the PiPower to the Protective Cover Plate. Note that the M2.5x6mm screws in the PiPower are required here. 4.1. Powered by PiPower...
  • Page 36 TS7-Pro 7-inch Touch Screen 3. Put the Protective Cover Plate back on. Chapter 4. ADDING PERIPHERAL DEVICES...
  • Page 37 TS7-Pro 7-inch Touch Screen 4. Connect the PiPower to the Raspberry Pi with a USB cable. 4.1. Powered by PiPower...
  • Page 38 TS7-Pro 7-inch Touch Screen 5. Turning the PiPower switch to ON will allow the Raspberry Pi to boot up. Chapter 4. ADDING PERIPHERAL DEVICES...
  • Page 39: Assemble And Use A Camera Module

    TS7-Pro 7-inch Touch Screen 4.2 Assemble and Use a Camera Module Required Components • TS7-Pro Screen • Camera Module (Self-provided) • Raspberry Pi (Self-provided) Hole size for mounting the Camera module: Mount Camera Module Refer to the following tutorial to mount the camera module.
  • Page 40 TS7-Pro 7-inch Touch Screen Chapter 4. ADDING PERIPHERAL DEVICES...
  • Page 41 TS7-Pro 7-inch Touch Screen Enable the Camera Open Raspberry Pi Configuration. In the Interfaces option, Enable the Camera, and then click OK. 4.2. Assemble and Use a Camera Module...
  • Page 42 TS7-Pro 7-inch Touch Screen In the pop-up prompt box, choose to restart now. After the restart is complete, use the following command line to check whether the camera is available. If the camera screen appears it means that the camera is installed successfully. Otherwise the FFC cable needs to be unplugged and plugged in again.
  • Page 43: Mount The Hard Disk

    • TS-7 Pro Screen • 2.5” Hard Disk (Self-provided) • Raspberry Pi 4(Self-provided) Hole size for mounting the hard disk: Assemble the Hard Disk Follow the tutorial below to mount the Hard Disk on the TS7-Pro Screen. 4.3. Mount the Hard Disk...
  • Page 44 TS7-Pro 7-inch Touch Screen Booting RPi from Hard Disk To boot Raspberry Pi with Hard Disk, you need to update the Bootloader of Raspberry Pi, then install Raspberry Pi OS on Hard Disk, and finally reboot Raspberry Pi and Hard Disk.
  • Page 45 TS7-Pro 7-inch Touch Screen 4. Scroll to the bottom of the page and select Misc utility images. 5. Select Bootloader. 4.3. Mount the Hard Disk...
  • Page 46 TS7-Pro 7-inch Touch Screen 6. Select a boot-mode, SD card boot is recommended. 7. Select SD card and then Write, you will be prompted that all data on this Micro SD card will be erased, so it is recommended to select a spare SD card.
  • Page 47 TS7-Pro 7-inch Touch Screen 8. Once the following message appears, you can unplug the card reader from the computer. 9. The green activity LED will blink with a steady pattern and the screen will be green on success. 4.3. Mount the Hard Disk...
  • Page 48 TS7-Pro 7-inch Touch Screen 10. Power off the Raspberry Pi and remove the Micro SD card. 11. Now to install the Raspberry Pi OS on your hard disk. Connect your hard disk to your computer with the cable that came with the drive.
  • Page 49 TS7-Pro 7-inch Touch Screen 12. Open the Raspberry Pi Imager, click CHOOSE OS -> Raspberry Pi OS(other) -> Raspberry Pi OS(Legacy). Note: Of course you can also choose the latest version of Raspberry Pi OS (Debian Bullseye), but Debian Bullseye version will cause some features to not work, so it is recommended to continue using the Debian Buster version.
  • Page 50 TS7-Pro 7-inch Touch Screen 13. After installation, unplug your hard disk and plug it into the USB port of the Raspberry Pi. Now power up the Raspberry Pi and you will see the Raspberry Pi desktop. Chapter 4. ADDING PERIPHERAL DEVICES...
  • Page 51 TS7-Pro 7-inch Touch Screen • Using Commands 1. Run the following commands to update Raspberry Pi OS to get the latest version of the rpi-eeprom package. sudo apt update sudo apt full-upgrade 2. Run following command to open the Raspberry Pi Software Configuration Tool.
  • Page 52 TS7-Pro 7-inch Touch Screen 8. Now power up the Raspberry Pi again and you will see the Raspberry Pi desktop. You can refer to the official Raspberry Pi tutorial at: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#updating-the-bootloader Warning: If you are trying to get Raspberry Pi 4B to boot from Micro SD card again, but found that it cannot boot and black screen.
  • Page 53: Extend Gpio To Breadboard

    TS7-Pro 7-inch Touch Screen 4.4 Extend GPIO to Breadboard This screen also retains the 40pin interface of the Raspberry Pi, which can be used for projects. You need to pay attention to the inserting direction of the 40pin cable to avoid burning the Raspberry Pi.
  • Page 54: Hang On The Wall

    TS7-Pro 7-inch Touch Screen 4.5 Hang on the Wall Hole size for wall hanging: Chapter 4. ADDING PERIPHERAL DEVICES...
  • Page 55 TS7-Pro 7-inch Touch Screen 1. Flip the Raspberry Pi over and insert it into the expansion board of the touch screen. 2. Plug in the HDMI Bridge and provide both Pi3 and Pi4 versions, you can choose as you need.
  • Page 56 TS7-Pro 7-inch Touch Screen 3. Insert the USB Bridge. Chapter 4. ADDING PERIPHERAL DEVICES...
  • Page 57 4. Screw 4 sets of M3x6 screws and M3 x 25 Standoff into the protective cover plate with the stanoffs on the back. 5. Turn the protective cover plate over and fasten it to the wall with 4 M3xxx screws. 6. Secure the TS7-Pro screen to the standoffs with 4 M3x6 screws. 4.5. Hang on the Wall...
  • Page 58: Using As Extension Screen For Pc

    TS7-Pro 7-inch Touch Screen 4.6 Using as Extension Screen for PC If you want to use this screen as an extended Touch Screen for your PC, then you need to connect this Touch Screen to your PC with a Micro USB cable and a HDMI cable. Some computers do not have enough power supply and it is recommended to plug in extra power to the touch screen.
  • Page 59 TS7-Pro 7-inch Touch Screen 4.6. Using as Extension Screen for PC...
  • Page 60 TS7-Pro 7-inch Touch Screen Chapter 4. ADDING PERIPHERAL DEVICES...
  • Page 61: Projects And Activities

    CHAPTER FIVE PROJECTS AND ACTIVITIES To get started using this screen, this chapter includes some interesting and challenging projects to choose from. 5.1 Multimedia Options Watch videos, read e-books, or play games on this screen. 5.1.1 Watch Video The Raspberry Pi has a built-in video player: VLC Video Player. Watch a local video directly by double-clicking on the VLC Video Player icon, or log in to the YouTube website from Google Chrome browser to watch videos.
  • Page 62 TS7-Pro 7-inch Touch Screen 5.1.2 Read E-book Read online from the Google Chrome browser. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 63 TS7-Pro 7-inch Touch Screen 5.1.3 Play Game Click Preferences -> Recommended Software -> Games to install games on this screen. For example, install Minecraft, and plug in a keyboard and mouse to play. 5.1. Multimedia Options...
  • Page 64: Retro Games Console

    TS7-Pro 7-inch Touch Screen 5.2 Retro Games Console 5.2.1 Description You can turn this screen Raspberry Pi into a retro games console playing with your friends, let’s see how we can do it! Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 65 TS7-Pro 7-inch Touch Screen 5.2.2 Required Components • A Screen • 8G+ MicroSD Card • Micro-SD Card Reader • Keyboard • Gamepad It is recommended to use a Raspberry Pi 4 as the main control board, with Retro Pie as the Operating System.
  • Page 66 TS7-Pro 7-inch Touch Screen This screen is a 1280x800 LCD touch screen, allowing for high resolution and sound quality to provide an excellent gaming experience. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 67 TS7-Pro 7-inch Touch Screen 5.2.3 Game System Installation RetroPie allows you to turn your Raspberry Pi, ODroid C1/C2, or PC into a retro-gaming machine. It builds upon Raspbian OS, Emulation Station, RetroArch and many other projects to enable you to play your favorite Arcade, home-console, and classic PC games with the minimum set-up.
  • Page 68 TS7-Pro 7-inch Touch Screen Installing RetroPie: Step 1: Download the SD image compatible with the Raspberry Pi 4 on the RetroPie official website. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 69 TS7-Pro 7-inch Touch Screen Step 2: After the download is complete, unzip the downloaded package containing the image file. Step 3: Then flash the RetroPie image into the micro-SD card. • For Windows, use: Raspberry Pi Imager, Etcher, or Win32DiskImager.
  • Page 70 TS7-Pro 7-inch Touch Screen Step 4: Insert the micro-SD card into the Raspberry Pi, and press the power button to boot up the system. 5.2.4 RetroPie Configuration After the Raspberry Pi boots up, the Controller and WiFi settings should be configured, as well as transferring game ROMs.
  • Page 71: Printer Monitor

    TS7-Pro 7-inch Touch Screen 5.3 3D Printer Monitor When using a 3D printer, we will need to use OctoPrint. It is an open source 3D printer controller application, which provides a web interface for the connected printers. It displays printers’ status and key parameters and allows user to schedule prints and remotely control the printer.
  • Page 72 TS7-Pro 7-inch Touch Screen Please refer to Install the Raspberry Pi • Webcam Option: A camera will need to be installed on this screen for webcam use. Please refer to the tutorial: Assemble and Use a Camera Module. • Touch UI Option: A new Raspberry Pi image might not have an auto start function for Touch UI. Please refer...
  • Page 73 TS7-Pro 7-inch Touch Screen Select the version you need. When installing Ultimaker Cura, please note that in the choose components step, Open STL files with Cura has been checked by default, so that .stl files can be sliced. If you want to slice other types of model files, check the corresponding option, otherwise you can install it directly.
  • Page 74 TS7-Pro 7-inch Touch Screen When opening Ultimaker Cura for the first time, there will be a series of configuration prompts. At the Add a Printer step, select the model of printer used and click Next. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 75 TS7-Pro 7-inch Touch Screen After selecting the correct printer model, verify that the parameters provided by Ultimaker Cura in the Machine Settings page are correct, or change the parameters directly. Follow the onscreen prompts to complete the configuration of Ultimaker Cura.
  • Page 76 TS7-Pro 7-inch Touch Screen Once Ultimaker Cura has successfully launched, click the Folder icon in the upper left-hand corner and browse to the folder with the .stl 3D model file that needs to be sliced, and click Open to add the .stl file to Ultimaker Cura’s library.
  • Page 77 TS7-Pro 7-inch Touch Screen After the file has been added, click the Slice option in the lower right-hand corner, and Ultimaker Cura will automati- cally perform the slicing operation. After slicing is complete, click the Save to Disk option in the lower right corner to save the sliced file locally.
  • Page 78 TS7-Pro 7-inch Touch Screen 5.3.3 Print 3D Model After the .stl file has been sliced, the 3D model file can be sent to the 3D printer through OctoPrint to be printed. Open the Raspberry Pi’s browser, and enter http://192.168.18.179/?#temp to log in to OctoPrint.
  • Page 79 TS7-Pro 7-inch Touch Screen Click the Upload option to select the sliced 3D model file. 5.3. 3D Printer Monitor...
  • Page 80 TS7-Pro 7-inch Touch Screen Click the print icon. The 3D printer will start to print the 3D model file after the slicing process is complete. If you have transferred the sliced file to the Raspberry Pi, you can also open the OctoPrint UI in Raspberry Pi to print.
  • Page 81: Home Assistant

    TS7-Pro 7-inch Touch Screen 5.3.4 Video The following video shows that after installing OctoPrint, connect your 3D printer and this screen through a USB cableupload the designed 3D file, and then use the camera to monitor the printing process. The temperature can also be monitored to prevent the 3D printer from getting too hot or cold, which will affect the printed 3D model.
  • Page 82 TS7-Pro 7-inch Touch Screen 5.4.1 Install Home Assistant Install Docker Here will introduce how to use the container environment to install and run Home Assistant. We recommend using Docker as the container environment. The way to install Docker is very simple, just run the following commands.
  • Page 83 TS7-Pro 7-inch Touch Screen Now you can enter http://<localhost>:8123 in the browser to enter the Home Assistant operation interface. For example, my Raspberry Pi IP is 192.168.6.136, then visit http ://192.168.6.136:8123. Note: 1. If you need to configure boot-up, please refer to: Start the Home Assistant Service at Boot 2.
  • Page 84 TS7-Pro 7-inch Touch Screen esphome dashboard config/ Configure ESPHome 1. Open a browser and enter ESPHome Dashboard through http://localhost:6052 http://X.X.X.X:6052 (replace X.X.X.X with your Raspberry Pi’s IP address). 2. Create configuration. Click on the “+” to start adding configurations. Enter a name and the WiFi and password that you need to have your device connect to and then click NEXT.
  • Page 85 TS7-Pro 7-inch Touch Screen Select the device type (ESP32 for example). 5.4. Home Assistant...
  • Page 86 TS7-Pro 7-inch Touch Screen Enter Once added, you will see them in the Dashboard of ESPHome. Note: When it is not the first time to add a device, click “+” on the main page, follow the prompts to enter the device name, WIFI and password, select the device type.
  • Page 87 TS7-Pro 7-inch Touch Screen 3. Edit the .yaml file. Click EDIT in the bottom right corner to go inside the .yaml file, you will see the following default components. 5.4. Home Assistant...
  • Page 88 TS7-Pro 7-inch Touch Screen • esphome: Contains the name, platform, and board type that you set up. • logger: The logger component automatically logs all log messages through the serial port and through MQTT topics. • api: The ESPHome native API is used to communicate with clients directly, with a highly-optimized network protocol.
  • Page 89 TS7-Pro 7-inch Touch Screen the configured WiFi fails. After 1 minute of unsuccessful WiFi connection attempts, the ESP will start a WiFi hotspot (with the credentials from your configuration). Now start to add other components. There are a lot of components in the ESPHome official...
  • Page 90 TS7-Pro 7-inch Touch Screen 4. Install the .yaml file to ESP32 board. After editing, click INSTALL in the lower right corner to compile and install. There are 2 methods for you to choose: Wirelessly and USB Port. But for the first installation you need to connect the ESP32 board to the Raspberry Pi using USB and then choose the second installation method.
  • Page 91 TS7-Pro 7-inch Touch Screen After successful installation, if you connect an LED to GPIO16 in ESP32 board, you will see the LED is lit. Also please record this IP, you will need to fill in this IP when you add ESPHome to Home Assistant.
  • Page 92 TS7-Pro 7-inch Touch Screen 2. Create a name for your home and select your region. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 93 TS7-Pro 7-inch Touch Screen 3. Select the content you want to share to Home Assistant. 5.4. Home Assistant...
  • Page 94 TS7-Pro 7-inch Touch Screen 4. You can choose to configure the device now, or later. It is recommended that beginners configure the device later, as the configuration is described in detail later in the tutorial. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 95 TS7-Pro 7-inch Touch Screen 5. After setting up, enter your login username and password in the login screen. Note: If the login screen does not jump automatically, please open Home Assistant again via http://localhost:8123. After logging in successfully, you will enter your Home.
  • Page 96 TS7-Pro 7-inch Touch Screen 5.4.4 Add Smart Devices You can add your purchased smart devices to Home Assistant, such as smart sound, smart desk lamp, etc. You can also make your DIY device with ESP32 and add it in. In this section, you will learn how to add your smart devices.
  • Page 97 TS7-Pro 7-inch Touch Screen Now back to home assistant(refer to In), click Configuration in the left column, select Intergrations. 5.4. Home Assistant...
  • Page 98 TS7-Pro 7-inch Touch Screen If Home Assistant finds a device on your network, it will display the corresponding integration, which can be eas- ily added with just a few clicks. If your smart device has not been discovered yet, don’t worry, click the + ADD INTEGRATION button at the bottom right and search for your integration in the list.
  • Page 99 TS7-Pro 7-inch Touch Screen Each integration may be different in use, you can visit Home Assistant Integration for details. Return to the Overview page. If the device you just added does not appear, you need to Edit Dashboard. 5.4. Home Assistant...
  • Page 100 TS7-Pro 7-inch Touch Screen 5.4.5 Add DIY Device with ESP32 You can add your purchased smart devices to Home Assistant, such as smart sound, smart desk lamp, etc. You can also make your DIY device with ESP32 and add it in.
  • Page 101 TS7-Pro 7-inch Touch Screen 2. If Home Assistant finds a device on your network, it will display the corresponding integration, which can be easily added with just a few clicks. If your smart device is not yet discovered, don’t worry, you can add it via the + ADD INTERGATION button at the bottom right.
  • Page 102 TS7-Pro 7-inch Touch Screen 3. Search for ESPHome in the pop-up window and fill in the Host (the IP recorded after the INSTALL step in chapter:ref:Install and configure ESPHome), with the option to place your esp-light in the bedroom, kitchen or other area of your choice.
  • Page 103 TS7-Pro 7-inch Touch Screen After clicking SAVE, you will be able to use this Button to control the esp-light (if you connect an LED to GPIO16 in ESP32 board, click on the Button to make the LED light up or turn off).
  • Page 104 TS7-Pro 7-inch Touch Screen For more styles, you can refer to Official Demo. 5.4.6 Start the Home Assistant Service at Boot Normally, Docker is self-starting after booting by default, which also means that after you install Home Assistant, you can use it as long as you start the Raspberry Pi.
  • Page 105 TS7-Pro 7-inch Touch Screen 4. Exit full screen. computer: Method 1: Press F11. Method 2: Move the mouse to the upper column of the screen and click the exit button that appears. Method 3: Right-click the pop-up menu, select “Exit full screen”.
  • Page 106 TS7-Pro 7-inch Touch Screen 5.4.8 Home Assistant File Structure Homeassistant creates a configuration file by default under the path of the executing user (created homeassistant) at the ~/.homeassistant path. The file directory structure is as follows: • .storage directory contains a lot of user-related information, including user login information (user- name/password, encrypted in auth_provider.homeassistant file).
  • Page 107: Cloud4Rpi

    TS7-Pro 7-inch Touch Screen 5.5 Cloud4RPi Cloud4RPi is a cloud-based control panel for IoT projects. Cloud4RPi uses dashboard widgets to control IoT devices remotely and show real-time device data. 5.5.1 Quick Guide on Cloud4RPi Install Cloud4RPi in Your Raspberry Pi It is advisable to update your system before installing.
  • Page 108 TS7-Pro 7-inch Touch Screen Once logged in, you should see two buttons at the top of Cloud4RPi, Devices to display the device connections and Control Panels to display the information received or sent from the Raspberry Pi on the webpage.
  • Page 109 TS7-Pro 7-inch Touch Screen Open the terminal of the Raspberry Pi and download the test examples provided by Cloud4RPi. /home/pi git clone https://github.com/cloud4rpi/cloud4rpi-raspberrypi-python.git Use a text editor such as Nano to modify the content of the control.py file. cloud4rpi-raspberrypi-python sudo nano control.py Find the following line of code.
  • Page 110 TS7-Pro 7-inch Touch Screen Using the Cloud4RPi Control Panels The control panel on the Cloud4RPi server provides many useful widgets for IoT applications. These widgets can be used to control the conponents or display sensor data. After entering Control Panels, click the New Control Panel button.
  • Page 111 TS7-Pro 7-inch Touch Screen For example, we select the Text widget and then select Hot Water °C, so that we can see it on the newly created control panel. 5.5. Cloud4RPi...
  • Page 112 TS7-Pro 7-inch Touch Screen Note: We will introduce these displayed data in detail in the chapter Learn More about control.py. 5.5.2 Learn More about control.py In order to better understand the projects that follow, let’s take a look at the official sample code provided by Cloud4RPi.
  • Page 113 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.
  • Page 114 TS7-Pro 7-inch Touch Screen cp -r /home/pi/ts7-pro/iot/ * /home/pi/cloud4rpi-raspberrypi-python Temperature and Humidity Acquisition In this project, we use DHT11 to read the surrounding temperature and humidity, and then display them on Cloud4RPi. Experimental Procedures Build the circuit. Open the code.
  • Page 115 TS7-Pro 7-inch Touch Screen Select a Chart widget with both Room Temp and CPU Temp as the variables to be displayed. 5.5. Cloud4RPi...
  • Page 116 TS7-Pro 7-inch Touch Screen Once added, you will see the temperature (Room Temp) and humidity (CPU Temp) curves over time, and you can adjust the display window by clicking on the options at the bottom right. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 117 TS7-Pro 7-inch Touch Screen Code Explanation dht11 DHT11.DHT11(17) Instantiate a dht11 object. getTem(): result dht11.get_result() while True: result: break else: result dht11.get_result() return result[1] The temperature (result[1]) is obtained by this function, and the function will not be interrupted until the reading is successful.
  • Page 118 TS7-Pro 7-inch Touch Screen (continued from previous page) 'type': 'numeric', 'bind': getTem 'CPU Temp': { 'type': 'numeric', 'bind': getHum The temperature is stored in the 'bind' of the 'Room Temp' key, and the humidity is stored in the 'bind' of the 'CPU Temp' key.
  • Page 119 TS7-Pro 7-inch Touch Screen Go to Cloud4RPi, add a new Control Panel named project2, and click Add Widget to add a Switch widget. Once added, you can use the Switch widget to control the relay. 5.5. Cloud4RPi...
  • Page 120 TS7-Pro 7-inch Touch Screen Code Explanation RELAY_PIN Relay connected to GPIO18 of the T-expansion board. GPIO.setmode(GPIO.BCM) GPIO.setup(RELAY_PIN, GPIO.OUT) Set to BCM nomenclature and set RELAY_PIN to output. relay_control(value=None): GPIO.output(RELAY_PIN, value) return GPIO.input(RELAY_PIN) This function controls the relay according to the value and returns the current level of the relay.
  • Page 121 TS7-Pro 7-inch Touch Screen Experimental Procedures Build the circuit. Open the code. /home/pi/cloud4rpi-raspberrypi-python sudo nano smart_light.py Find the line below and fill in the correct device token. DEVICE_TOKEN '__YOUR_DEVICE_TOKEN__' Run the code. sudo python3 smart_light.py Go to Cloud4RPi, add a new Control Panel named project3, and click Add Widget to add a Slider widget.
  • Page 122 TS7-Pro 7-inch Touch Screen Once added, you can use the Slider widget to control the brightness of the LED. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 123 TS7-Pro 7-inch Touch Screen Code Explanation led_val GPIO.PWM(LED_PIN, 2000) led_val.start(0) Call the GPIO.PWM() function to define LED_PIN as PWM pin and set the frequency of PWM pin to 2000Hz, then use the start() function to set the initial duty cycle to 0.
  • Page 124 TS7-Pro 7-inch Touch Screen Experimental Procedures Build the circuit. Open the code. /home/pi/cloud4rpi-raspberrypi-python sudo nano smart_curtain.py Find the line below and fill in the correct device token. DEVICE_TOKEN '__YOUR_DEVICE_TOKEN__' Run the code. sudo python3 smart_curtain.py Go to Cloud4RPi, add a new control panel named project4 and add 3 widgets (Switch, Text and Chart widgets) via the Add Widget button.
  • Page 125 TS7-Pro 7-inch Touch Screen Once added, you can use the Switch widget to control the LED; the value of the photoresistor on the Text widget will be updated every 1 minute, when the value > 100, the motor rotates clockwise for 5 seconds; if the value is less than 20, the motor rotates counterclockwise for 5 seconds.
  • Page 126 TS7-Pro 7-inch Touch Screen (continued from previous page) 'bind': getValue Pass getValue() into the 'bind' key as a callback function, so that the brightness value (the return value of the getValue() function) can be sent to the Text widget. Attendance system In this project, we use MFRC522 RFID Module and Cloud4RPi to make a system, you can view the attendance information on Cloud4RPi, or open the local .csv file to view the attendance records.
  • Page 127 TS7-Pro 7-inch Touch Screen Open the code. /home/pi/cloud4rpi-raspberrypi-python sudo nano attendance_system.py Find the line below and fill in the correct device token. DEVICE_TOKEN '__YOUR_DEVICE_TOKEN__' Run the code. sudo python3 attendance_system.py Go to Cloud4RPi, add a new control panel named project5 and add 2 widgets (text and chart widgets) via the Add widget button.
  • Page 128 TS7-Pro 7-inch Touch Screen Open it with the following command. sudo nano attendance_sheet.2021.06.28.csv In this way, you can read the punch-in records of different time periods. On the left is the ID of different MFRC522 RFID modules, and on the right is the time of punching in.
  • Page 129 TS7-Pro 7-inch Touch Screen Code Explanation RedPin GreenPin GPIO.setmode(GPIO.BOARD) GPIO.setup(RedPin, GPIO.OUT, initial=GPIO.HIGH) GPIO.setup(GreenPin, GPIO.OUT, initial=GPIO.HIGH) Set 2 LEDs as output and set the initial value to high. get_time(): time.time() year str(time.strftime('%Y',time.localtime(time.time()))) month str(time.strftime('%m',time.localtime(time.time()))) str(time.strftime('%d',time.localtime(time.time()))) hour str(time.strftime('%H',time.localtime(time.time()))) minute str(time.strftime('%M',time.localtime(time.time()))) second str(time.strftime('%S',time.localtime(time.time())))
  • Page 130: Gpio Programming

    Note: Refer to Extend GPIO to Breadboard instructions for extending the 40 pins of the Raspberry Pi to a breadboard. SunFounder has a very complete course system about Raspberry Pi GPIO learning kits, such as the following two learning kits. •...
  • Page 131: Scratch Projects

    TS7-Pro 7-inch Touch Screen 5.6.2 Da Vinci Kit for Raspberry Pi Tutorial Link https://docs.sunfounder.com/projects/davinci-kit-for-raspberry-pi/en/latest/ Product Link Global: https://www.sunfounder.com/products/sunfounder-davinci-kit United States: https://www.amazon.com/dp/product/B07WV2HYC6 Japan: https://www.amazon.co.jp/dp/product/B083SJQXCL Canada: https://www.amazon.de/dp/B07WYX8M76 Germany: https://www.amazon.ca/dp/product/B07KH2C215 5.7 Scratch Projects In this chapter, you will learn to use Scratch on this screen, which includes 10 examples.
  • Page 132 TS7-Pro 7-inch Touch Screen Note: Before trying the teaching examples, you should have downloaded the relevant materials and code files. Open a Terminal and enter the following command to download them from github. git clone https://github.com/sunfounder/ts7-pro Projects 5.7.1 Animate A Name Description Today we will learn to write our name on Scratch.
  • Page 133 TS7-Pro 7-inch Touch Screen First delete the original sprite, we don’t need it. Then choose a sprite. 5.7. Scratch Projects...
  • Page 134 TS7-Pro 7-inch Touch Screen Find the Letter sprite. Repeat several times to spell out your name, like me, “Abby”. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 135 TS7-Pro 7-inch Touch Screen 5.7. Scratch Projects...
  • Page 136 TS7-Pro 7-inch Touch Screen A can change its color. Click on the Glow-A sprite and let’s write a bit of code for it. When A is clicked, it changes its color. Click on the sprite, find when this sprite cliked in Events, and drag it to the right coding area.
  • Page 137 TS7-Pro 7-inch Touch Screen At this time, we click on the letter A on the stage and it will change its color. B can rotate 360°. Click on the Glow-B sprite, let’s write a code for the Glow-B wizard. When the letter B on the stage is clicked, it will rotate in a circle.
  • Page 138 TS7-Pro 7-inch Touch Screen Do you know why B is rotated 15 degrees 24 times? Because 24*15=360, it turns 360 degrees! B2 can zoom in and out. Click on the Glow-B2 sprite, and let us write a code for the Glow-B2 sprite.
  • Page 139 TS7-Pro 7-inch Touch Screen Y can show and disappear. Click on the Glow-Y sprite and let us write a piece of code for the Glow-Y sprite. When the Y on the stage is clicked, it will repeatedly disappear and appear.
  • Page 140 TS7-Pro 7-inch Touch Screen 5.7.2 Create a Story Description Do you like to hear stories? For example, before going to bed, you can have a sweet dream at night by listening to a little story from your parents. Today we are going to “tell” the story of a little monkey looking for a banana on Scratch.
  • Page 141 TS7-Pro 7-inch Touch Screen First the current sprite, and then click the Choose a Sprite button to add the sprite. Here we need to find Monkey, click on it! You can use the search box above to find it. Here we give it a name Harley.
  • Page 142 TS7-Pro 7-inch Touch Screen Harley is hungry. He asked his friend Perry where is the banana? Click on your Harley sprite, and then click on the Event category. Drag when clicked to the coding area on the right. Click on the Looks category and drag say “Hello!” for 2 second to the bottom of “when clicked”.
  • Page 143 TS7-Pro 7-inch Touch Screen Change what it says and how long it says in the input box. Perry had seen bananas in the park, so he told Harley. Perry is a Frog, add Frog sprite and Forest backdrop. 5.7. Scratch Projects...
  • Page 144 TS7-Pro 7-inch Touch Screen Click on the Frog sprite, add a 3 second delay block (wait for Harley to finish speaking), and then it speaks. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 145 TS7-Pro 7-inch Touch Screen Now, click on the green flag, we can see Harley and Perry chat. Harley went to the park and found bananas on the table. Now, click on the Backdrop and let it switch after 6 seconds (after the conversation ends).
  • Page 146 TS7-Pro 7-inch Touch Screen But Harley should come to the park alone, and there should be bananas on the table. So, we have to make Perry “disappear”. Click on the Frog sprite, add an event, when backdrop switches to. . . , and find “hide” and “show” in Looks. Let the Perry appear at the right time! Chapter 5.
  • Page 147 TS7-Pro 7-inch Touch Screen Add the Banana sprite and adjust the angle. 5.7. Scratch Projects...
  • Page 148 TS7-Pro 7-inch Touch Screen Also let it appear at the right time. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 149 TS7-Pro 7-inch Touch Screen Now, click on the green flag and you can see a complete story. Challenge Believe that you who are smart will be able to program and implement this game soon, then we will add some challenges to enrich our story content.
  • Page 150 TS7-Pro 7-inch Touch Screen Required Components • A Screen • Scratch 3 (either online or offline) You Will Learn • Use the Scratch Add Extension function to add music extension. • Modify the initial size of the sprite. • Let the sprites do some actions.
  • Page 151 TS7-Pro 7-inch Touch Screen 5.7. Scratch Projects...
  • Page 152 TS7-Pro 7-inch Touch Screen Play Drum-highhat. Click on the Drum-highhat sprite and drag out the play drum. . . block in the Music expansion module. Change the option to (5) Open Hi-Hat, then use the “next costume” block to switch the appearance of Drum-highhat.
  • Page 153 TS7-Pro 7-inch Touch Screen Play Drum-snare. Click on the Drum-snare sprite and drag out the play drum. . . block in the Music expansion module. Change the option to (1) Snare Drum, then use the “next costume” block to switch the appearance of Drum-snare.
  • Page 154 TS7-Pro 7-inch Touch Screen Challenge I believe that you will be smart enough to program and implement this game soon. Next, we will add some challenges to enrich our game content. • Add Drum sprite, Drum Kit sprite and Drum-cymbal sprite, modify their size, and choose suitable sound effects.
  • Page 155 TS7-Pro 7-inch Touch Screen Set the balloon to a random position. 5.7. Scratch Projects...
  • Page 156 TS7-Pro 7-inch Touch Screen Let it change the color and size randomly. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 157 TS7-Pro 7-inch Touch Screen Now, run the green flag and you can see the balloons randomly change in the stage area. Click on the balloon to add score. Now, we need to establish a scoring mechanism. Whenever the balloon is clicked, the score will increase by one.
  • Page 158 TS7-Pro 7-inch Touch Screen We will see it in the upper left corner of the stage. When the balloon is clicked, the score is increased by one. When you click the green flag (the game starts), the score will be reset to zero.
  • Page 159 TS7-Pro 7-inch Touch Screen Now, click the green flag above the stage area to start the game, and click the balloon to increase your score! Challenge I believe that you will be smart enough to program and implement this game soon. Next, we will add some challenges to enrich our game content.
  • Page 160 Lesson Guide Arrange the Crosshair and targets. First, delete the previous sprite, upload the Crosshair sprite and the target background, you can find them under the path ts7-pro/scratch/materials (You have downloaded from github - ts7-pro before.). Click the icon below the sprite list, select “Upload Sprite Option”, find the Cross Hair.svg file, and upload it. Similarly, upload the backdrop, Target.jpg.
  • Page 161 TS7-Pro 7-inch Touch Screen 5.7. Scratch Projects...
  • Page 162 TS7-Pro 7-inch Touch Screen Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 163 TS7-Pro 7-inch Touch Screen Let’s take aim. When aiming, the Crosshair will slightly shake, we are now going to use the glide. . . block to achieve this effect. Set the random position and size of the Crosshair sprite. 5.7. Scratch Projects...
  • Page 164 TS7-Pro 7-inch Touch Screen Now, click on the green flag to see the effect of this aiming. . . very good. Let’s guess, change the time in the glide. . . block, will the front sight become more stable? Or is it more swaying? Let’s shoot!
  • Page 165 TS7-Pro 7-inch Touch Screen Click the green flag to try the effect! Calculate the score! Then we need to establish a scoring mechanism. Shooting different color circles will get different scores. The closer to the bullseye, the higher the score.
  • Page 166 TS7-Pro 7-inch Touch Screen Use the same method to set corresponding scores for different color circles. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 167 TS7-Pro 7-inch Touch Screen 5.7. Scratch Projects...
  • Page 168 TS7-Pro 7-inch Touch Screen Challenge I believe that you will be smart enough to program and implement this game soon. Next, we will add some challenges to enrich our game content. • In a game, you can shoot three rounds and then calculate the total score.
  • Page 169 TS7-Pro 7-inch Touch Screen Let the Fish appear at the coordinates (-240,120), and then let it swim left and right. Use the if on edge, bounce block to make the Fish sprite fold back from the edge. When it hits the wall, it will fold back in the opposite direction to the original.
  • Page 170 TS7-Pro 7-inch Touch Screen This Star is rising. Let the Star appear at (0,-120). If we press the ← or key on the keyboard, it will go left and right. We use the key . . . pressedblock to determine the keyboard, and use change x by . . . to move the sprite.
  • Page 171 TS7-Pro 7-inch Touch Screen Next, launch the Star. If the space bar is pressed, the y coordinate value of the Star sprite will increase, and the Star sprite will rise. 5.7. Scratch Projects...
  • Page 172 TS7-Pro 7-inch Touch Screen Something is wrong. The Star sprite should continue to rise until it reaches the height of the Fish sprite (remember? Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 173 TS7-Pro 7-inch Touch Screen The y coordinate we set for Fish is 120) and then return. NowIt looks better. Fish hit by a Star. After the Star rises, before returning to the bottom, you need to use a touch. . . block to determine whether it hits the Fish.
  • Page 174 TS7-Pro 7-inch Touch Screen Back to the programming interface of the Fish sprite, use a when I receive. . . block to receive the “Hit” broadcast, and then use Next costumeto change your form. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 175 TS7-Pro 7-inch Touch Screen Calculate the score! To make the game more interesting! Add a scoring mechanism. When you click the green flag, the score will be reset to zero. When a “hit” event occurs, the score will increase by 1.
  • Page 176 TS7-Pro 7-inch Touch Screen Challenge I believe that you will be smart enough to program and implement this game soon. Next, we will add some challenges to enrich our game content. • Added several different magic fish. • One will get double points •...
  • Page 177 TS7-Pro 7-inch Touch Screen Or click Binary Game, and then learn online tutorial on the Scratch official website. Required Components • A Screen • Scratch 3 (either online or offline) You Will Learn • Understand binary numbers. • Convert binary numbers to decimal numbers.
  • Page 178 TS7-Pro 7-inch Touch Screen Set the default costume of the four sprites to Zero, record with the variables “num1”, “num2”, “num3”, and “num4” respectively, and initialize the positions of the four sprites. The program in the figure below is the program of the Zero sprite. The other three Zero sprites modify the variable names and increase the X coordinate by 80 to make the effect arranged in order from left to right.
  • Page 179 TS7-Pro 7-inch Touch Screen When we click the sign in front of the variable, the variable will disappear from the stage. 5.7. Scratch Projects...
  • Page 180 TS7-Pro 7-inch Touch Screen Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 181 TS7-Pro 7-inch Touch Screen Change the shape by clicking and record the binary value. If you click the Zero sprite, it will switch its costume to the next costume, and switch the value of the variable num1, if num1 = 0, change num1 to 1.
  • Page 182 TS7-Pro 7-inch Touch Screen The decimal number is equal to the sum of binary digits (dn) times their power of 2 (2^n): decimal = d0×2^0 + d1×2^1 + d2×2^2 + ... If binary is 1000, the corresponding decimal should be 1x2^3+0x2^2+0x2^1+0x2^0=8 So, what is the decimal number of 1010? 1*2^3+0*2^2+1*2^1+0*2^0=10.
  • Page 183 TS7-Pro 7-inch Touch Screen Programming the Enter Sprite After you understand the conversion of binary numbers and decimal numbers, let’s program the Enter sprite. First, we create a result variable, when the Enter sprite is clicked, We convert the binary number composed of the num1 variable, num2 variable, num3 variable and num4 variable into a decimal number, and save the result in the result variable.
  • Page 184 TS7-Pro 7-inch Touch Screen Now, click on the green flag above the stage area to start the game and explore the magical binary! Challenge I believe that you will be smart enough to program and implement this game soon. Next, we will add some challenges to enrich our game content.
  • Page 185 TS7-Pro 7-inch Touch Screen You Will Learn • Add more costumes to sprites and let them change their appearance • Logical Operation • Determine if the sprites are touching each other Lesson Guide Arrange the parrot and background image First, we delete the default sprites and add Parrot sprites and Blue Sky backdrop. Change the size of the Parrot sprite to 20.
  • Page 186 TS7-Pro 7-inch Touch Screen Copy out the second Trees. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 187 TS7-Pro 7-inch Touch Screen 5.7. Scratch Projects...
  • Page 188 TS7-Pro 7-inch Touch Screen Let the Parrot sprite fly on the stage Parrot stayed still, and the Trees and Trees2 sprites kept moving to the left, so it looked like the Parrot sprites were flying on the stage! Set the initial position and movement of the Trees sprite so that it can reach the far left from the far right of the stage.
  • Page 189 TS7-Pro 7-inch Touch Screen Now, click on the green flag to see the effect of this flight. . . Very good, the Parrot sprite seems to be flying to the right side of the stage. 5.7. Scratch Projects...
  • Page 190 TS7-Pro 7-inch Touch Screen Let the space button control Parrot to fly When the game starts, Parrot will continue to drop down, that is, the y coordinate will continue to decrease. When we press the space button, the y coordinate of Parrot will increase.
  • Page 191 TS7-Pro 7-inch Touch Screen Constantly increase the speed of Parrot falling through variables Parrot drop is a bit slow, we add flight variables to make Parrot drop more and more! 5.7. Scratch Projects...
  • Page 192 TS7-Pro 7-inch Touch Screen Change the costume so that Parrot has flight animation When we press the Space button, Parrot’s clothing switches to Parrot-b. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 193 TS7-Pro 7-inch Touch Screen 5.7. Scratch Projects...
  • Page 194 TS7-Pro 7-inch Touch Screen Calculate the score! Create a new score variable. When the Trees and Trees2 sprites move to the right side of the Parrot sprite, it means that Parrot has crossed the Trees and Trees2. At this time, we will add score+1. In order to avoid always adding points, we need to add it after score+1 Wait 1 second for the code.
  • Page 195 TS7-Pro 7-inch Touch Screen Game failure mechanism When the Parrot sprite encounters a tree or falls to the ground during the flight, we judge the game is over, and then we stop all scripts. Challenge I believe that you will be smart enough to program and implement this game soon. Next, we will add some challenges to enrich our game content.
  • Page 196 TS7-Pro 7-inch Touch Screen Required Components First, you need to prepare the following components: • A Screen • Scratch 3 (either online or offline) You Will Learn • Use the Pen extension function to draw on scratch. • Let the sprite move with the mouse.
  • Page 197 TS7-Pro 7-inch Touch Screen Then, we add the Pen extension function. 5.7. Scratch Projects...
  • Page 198 TS7-Pro 7-inch Touch Screen Add drawing function to Pencil sprite Click on the Pencil sprite. First, we need to make the Pencil sprite move with the mouse. If the mouse button is pressed, we call the pen down block in the Pen extension function, which can draw along the track of the cursor.
  • Page 199 TS7-Pro 7-inch Touch Screen Click on the green flag and try to control the Pencil sprite with the mouse to draw a smiley face. You will find that the image is not drawn from the tip of the Pencil. 5.7. Scratch Projects...
  • Page 200 TS7-Pro 7-inch Touch Screen Note: Since the cursor is not on the Pencil tip, the line drawn is drawn from the middle of the Pencil sprite. We click on the Costumes, select the entire Pencil sprite and move it until the Pencil tip is aligned with the cross cursor.
  • Page 201 TS7-Pro 7-inch Touch Screen Then we return the code of the Pencil sprite, and when it receives the “red” message, we change the color of the Pencil to red. In the same way, we also write code for the Blue sprite, and when it is clicked, we broadcast a new “blue” message.
  • Page 202 TS7-Pro 7-inch Touch Screen Return the code of the Pencil sprite. When it receives the “blue” message, we change the color of the Pencil to blue. Before painting, we clear the scene on the stage and set the Pencil color to red. Zoom in on the stage area and try your brush again.
  • Page 203 TS7-Pro 7-inch Touch Screen We started programming the Eraser sprite, and when it was clicked, we broadcast a new “eraser” message. Then continue to add code for the Pencil sprite. When it receives the “eraser” message, it will change to the Eraser costume, so that when we click on the Eraser sprite, we can change the Pencil sprite’s costume to look like an Eraser sprite.
  • Page 204 TS7-Pro 7-inch Touch Screen Toggle clothing and brush width tools. When the costume of the Pencil sprite is switched to Eraser, we need to switch the costume of the Pencil sprite to the Pencil-a costume by clicking the red and blue on the drawing board, so when we receive the “red” message and the “blue”...
  • Page 205 TS7-Pro 7-inch Touch Screen In order to make our painting function more fun, we need to be able to change the width of the Pencil at any time. Create a new variable named “width”, then right-click the “width” variable on the stage, select slider, and then you will see a slider on the stage that can change the value of the “width”...
  • Page 206 TS7-Pro 7-inch Touch Screen Use the value of the variable “width” as the size of the Pencil. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 207 TS7-Pro 7-inch Touch Screen 5.7. Scratch Projects...
  • Page 208 TS7-Pro 7-inch Touch Screen Limit the painting range of the Pencil. Only when the Pencil enters the drawing area, can painting be allowed. When the pen enters the toolbar, that is, when the y coordinate is less than or equal to -120, we need to call the pen up function to stop painting.
  • Page 209 TS7-Pro 7-inch Touch Screen 5.7. Scratch Projects...
  • Page 210 TS7-Pro 7-inch Touch Screen Challenge I believe that you will be smart enough to program and implement this game soon. Next, we will add some challenges to enrich our game content. • Add more color brushes to make a Paint Box that belongs to you.
  • Page 211 TS7-Pro 7-inch Touch Screen At this point, you can see the camera shot on the Scratch stage. Arrange monkeys and bananas First, we delete the original sprite, then add Monkey sprite and Bananas sprite, and change their sizes to 50.
  • Page 212 TS7-Pro 7-inch Touch Screen Let the Monkey appear in the center of the stage and initialize the camera data (transparency is set to 20). If the camera detects an object moving, let the Monkey move towards the object. Chapter 5. PROJECTS AND ACTIVITIES...
  • Page 213 TS7-Pro 7-inch Touch Screen Now, click on the green flag at the top of the stage area to start the game. Let the Monkey eat bananas, it is very hungry! Try to play this game on a white background to prevent interference from other objects.
  • Page 214 TS7-Pro 7-inch Touch Screen 5.7.11 Create Musical Instrument Description You can turn this screen into a game screen playing with your friends, a smart alarm showing the weather and time, a display monitoring your robot’s action and many other things.
  • Page 215 TS7-Pro 7-inch Touch Screen Required Components • A Screen • 8G+ SD Card • Scratch 3 (either online or offline) • Micro SD Card Reader • 40 Pin Ribbon Cable • T-Type GPIO Extension Board • Breadboard • Button • 10k Ohm Resistor •...
  • Page 216 TS7-Pro 7-inch Touch Screen Programming with Scratch 3 On the left of Scratch 3 main page are some neatly arranged blocks with which you can drag to program. In this project, we need to add in other two functions: Music and Raspberry Pi GPIO. The Music function to play instruments and drums, and the Raspberry Pi GPIO function can be used to control the whole pins of Raspberry Pi.
  • Page 217 TS7-Pro 7-inch Touch Screen Press these three buttons on the breadboard and there emits the tones “Do, Re, Mi”. 5.7. Scratch Projects...
  • Page 218 TS7-Pro 7-inch Touch Screen 5.7.12 DIY Monitor Device Description You can turn this screen into a game screen playing with your friends, a smart alarm showing the weather and time, a display monitoring your robot’s action and many other things.
  • Page 219 TS7-Pro 7-inch Touch Screen Required Components • A Screen • 8G+ SD Card • Scratch 3 (either online or offline) • Micro SD Card Reader • 40P Ribbon Cable • T-Type GPIO Extension Board • Breadboard • PIR Module • Camera Module •...
  • Page 220 TS7-Pro 7-inch Touch Screen Lesson Guide Build the Circuit First connect the GPIO Extension Board, please read for specific steps. Extend GPIO to Breadboard Plug the T-type GPIO extension board into the breadboard and build the circuit. For the camera installation tutorial, please refer to Assemble and Use a Camera Module.
  • Page 221 TS7-Pro 7-inch Touch Screen Tap Add icon at lower left corner and choose“Video Sensing”and“Raspberry Pi GPIO”to add two functions. Back to the main page, drag a“when gpio 0 is high”from Raspberry Pi GPIO function and a “play sound (hello) until done”to the coding area.
  • Page 222: Install Other Systems On Raspberry Pi

    TS7-Pro 7-inch Touch Screen Stick the pir module and camera to the wall outside the door, and stick the screen to the wall inside the door or anywhere. When the door is opened, you will hear music and then see who is there.
  • Page 223: Appendix

    CHAPTER APPENDIX For new Raspberry Pi users, the following sections are essential operations that will need to be used for doing certain projects. Please read these sections carefully. 6.1 Obtain the IP Address of the Raspberry Pi With a Screen If you have a screen, it will be easy for you to get the IP address of Raspberry Pi.
  • Page 224: Use The Ssh Remote Control

    TS7-Pro 7-inch Touch Screen Without a Screen After the Raspberry Pi is connected to WIFI, we need to get the IP address of it. There are many ways to know the IP address, and two of them are listed as follows.
  • Page 225 TS7-Pro 7-inch Touch Screen Type in ssh pi@ip_address where pi is the username and ip_address is the IP address of the Raspberry Pi. For example: pi@192.168.18.197 At the prompt, type yes in lowercase. The default password is raspberry. Note: The characters do not display when typing in the password. Make sure to input the correct password.
  • Page 226 TS7-Pro 7-inch Touch Screen We now get the Raspberry Pi connected and are ready to go to the next step. For Windows Users Windows users can use SSH with the PuTTY application. Download PuTTY, open the application, and click Session on the left of the tree-like structure. Enter the IP address of the Raspberry Pi in the text box under Host Name, and enter 22 under Port.
  • Page 227 TS7-Pro 7-inch Touch Screen Click Open. Note: When first logging in to the Raspberry Pi with the IP address, there will be a security prompt. Click Yes to continue. When the PuTTY window prompts login as:, type in pi for the user name of the Raspberry Pi. The default password is raspberry.
  • Page 228 TS7-Pro 7-inch Touch Screen Here, we get the Raspberry Pi connected and it is time to conduct the next steps. Chapter 6. APPENDIX...
  • Page 229: Faq

    CHAPTER SEVEN 7.1 Black border appears on the display? • Select the correct resolution Click the Raspberry Pi icon -> Preferences -> Screen Configuration. Then choose Configure -> Screens -> HDMI-1 -> Resolution -> choose the 1280x800.
  • Page 230 TS7-Pro 7-inch Touch Screen After that you need to click the tick icon to save your configure. • Disable Overscan/Underscan When using Raspberry Pi Imager to install a system on a Micro SD, you can check the Disable overscan. Chapter 7. FAQ...
  • Page 231 TS7-Pro 7-inch Touch Screen Or when you get to the desktop, click the Raspberry Pi icon -> Preferences -> Raspberry Pi Configu- ration. Disable Overscan in the Display page. 7.1. Black border appears on the display?
  • Page 232: No Sound

    TS7-Pro 7-inch Touch Screen 7.2 No Sound • If your display has no sound, you need to confirm the current Audio output mode. Analog mode is used to output to the headphones, and HDMI mode is output to the speakers.
  • Page 233: Can't Touch

    TS7-Pro 7-inch Touch Screen 7.4 Can’t touch? • Make sure the touch module is connected to the control board (or device) via the USB touch cable. • Check if the touch module is damaged, if so please contact us. 7.5 Use of the touch pen •...
  • Page 234 TS7-Pro 7-inch Touch Screen Chapter 7. FAQ...
  • Page 235 EIGHT COPYRIGHT NOTICE All contents including but not limited to texts, images, and code in this manual are owned by the SunFounder Company. You should only use it for personal study,investigation, enjoyment, or other non-commercial or nonprofit purposes, under therelated regulations and copyrights laws, without infringing the legal rights of the author and relevant right holders.

Table of Contents

Save PDF