SPI - Show PM2.5 concentration on ILI9341 TFT LCD
If you are not familiar with SPI, please read Introduction to SPI first.
Preparation
- Ameba x 1
- ILI9341 TFT LCD with SPI interface x 1
- Plantower PMS3003 or PMS5003 x 1
Example
This example extends previous PM2.5 example to show the PM2.5 concentration on the LCD.
Wiring of QVGA TFT LCD:
(Note: PMS3003/PMS5003 sensor requires 5V voltage)
Wiring of Adafruit TFT LCD:
RTL8710 Wiring Diagram:
Open the example, “Files” -> “Examples” -> “AmebaSPI” -> “PM25_on_ILI9341_TFT_LCD”
Compile and upload to Ameba, then press the reset button.
Then you can see the concentration value of PM1.0, PM2.5 and PM10 on the LCD.
Code Reference
In this example, first rotate the screen by 90 degrees, and draw the static components such as the circles, the measuring scale and the title text. After the concentration value is detected, it is printed inside the circle.
Realtek IoT/Wi-Fi MCU Solutions . All Rights Reserved. Terms of Use