EP-0251

From 52Pi Wiki
Jump to navigation Jump to search

Descriptions

This 1.3inch TFT RGB screen L-shaped expansion board is specifically designed to work in conjunction with the GeeekPi UPS Gen 6. It connects to the UPS Gen 6's PCB board via a single FPC (Flexible Printed Circuit) cable. The primary purpose of this expansion board is to enable the display of various UPS Gen 6 functions and data on the screen through the use of pikapython scripts sent from a Raspberry Pi.

EP-0251-0.jpg

Features

Display Capabilities

  • Resolution: The screen offers a resolution of 240x240 pixels, providing clear and detailed visuals.
  • Color Display: It is an RGB (Red, Green, Blue) color screen, capable of displaying a wide range of colors to enhance the visual representation of data.
  • Low Power Consumption: The screen is designed to be low power, consuming very little electricity, making it suitable for applications where energy efficiency is crucial.

Data Display and Control

  • Battery Data: Can display battery voltage and current, allowing users to monitor the battery status of the UPS Gen 6.
  • Input and Output Data: It can show the voltage and current of the input interface as well as the output voltage and current of the UPS Gen 6.
  • MCU Voltage and Current: The screen can also display the voltage and current of the MCU (Microcontroller Unit) within the UPS Gen 6.
  • Customizable Display: Users can customize the display content according to their requirements using the provided demo code and detailed instructions. This includes the ability to display specific data points and format them as desired.

Drawing and Graphics

  • API for Drawing: The screen supports the use of an API to draw various shapes and patterns. This includes:
  • Points
  • Lines
  • Surfaces
  • Rectangles
  • Circles
  • Creative Display: This functionality allows for the creation of custom graphics and visualizations on the screen, enabling users to design unique and informative displays.

Integration and Compatibility

  • Raspberry Pi Control: The expansion board is designed to work seamlessly with a Raspberry Pi, allowing for easy control and data transmission through pikapython scripts.
  • Compatible with Other SBCs: Orange Pi series with the same pin factor form as Raspberry Pi 4B and 5.
  • Easy Setup: With the provided demo code and detailed instructions, users can quickly set up and start using the expansion board to display the desired data and graphics on the screen.

This 1.3inch TFT RGB screen L-shaped expansion board provides a versatile and efficient solution for displaying UPS Gen 6 data and creating custom visualizations on a low-power, high-resolution screen.

Product Gallery

  • Product Outlook
EP-0251-6.jpg


  • Port Definitions
EP-0251-04.jpg


  • After Assembling
EP-0251-01.jpg


  • After uploading PiKaPython Script
EP-0251-02.jpg


  • Product Dimension
EP-0251-03.jpg


  • Compatibility
EP-0251-05.jpg


Package Includes

EP-0251-PL.jpg


How to use the OLED display?

Please refer to: [ https://github.com/geeekpi/upsv6_pub/blob/main/script/pikaPython_examples/TFT_Module/ ]

  • Demo code
from UPS import TFTModule as tft
from UPS import Device

# Init TFT module
tft.init()


def test_drawPixel():
    tft.drawPixel(10, 10, 0xF800)  # red pixel
    Device.sleep(200)
    tft.fillScreen(0x0000)  #  clear screen 

def test_drawLine():
    tft.drawLine(0, 0, 100, 100, 0x07E0)  # green cross line
    Device.sleep(200)
    tft.fillScreen(0x0000)

def test_drawFastVLine():
    tft.drawFastVLine(50, 0, 100, 0x001F)  #  blue vertical line
    Device.sleep(200)
    tft.fillScreen(0x0000)

def test_drawFastHLine():
    tft.drawFastHLine(0, 50, 100, 0xFFE0)  # yellow horizontal line  
    Device.sleep(200)
    tft.fillScreen(0x0000)

def test_drawRect():
    tft.drawRect(20, 20, 60, 60, 0xF81F)  # pink rectangle  
    Device.sleep(200)
    tft.fillScreen(0x0000)

def test_drawCircle():
    tft.drawCircle(50, 50, 30, 0x07FF)  # cyan circle 
    Device.sleep(200)
    tft.fillScreen(0x0000)

def test_fillRect():
    tft.fillRect(30, 30, 40, 40, 0x7E0F)  # purple filled rectangle  
    Device.sleep(200)
    tft.fillScreen(0x0000)

def test_drawTriangle():
    tft.drawTriangle(50, 10, 10, 90, 90, 90, 0x000F)  # deep blue trangle  
    Device.sleep(200)
    tft.fillScreen(0x0000)

def test_fillTriangle():
    tft.fillTriangle(50, 10, 10, 90, 90, 90, 0xF0F0)  # light pink filled trangle  
    Device.sleep(200)
    tft.fillScreen(0x0000)

def test_drawString():
    tft.drawString(10, 10, "Size 1", 0xF800, 0x0000, 1)  # red,size 1
    tft.drawString(10, 30, "Size 2", 0x07E0, 0x0000, 2)  # green,size 2
    tft.drawString(10, 60, "Size 3", 0x001F, 0x0000, 3)  # blue,size 3
    tft.drawString(10, 100, "Size 4", 0xFFE0, 0x0000, 4)  # yellow,size 4
    tft.drawString(10, 160, "FanSe 5", 0xFFFF, 0x07FF, 5)  # white,size 4

# run all test
while True:
    test_drawPixel()
    Device.sleep(1000)
    test_drawLine()
    Device.sleep(1000)
    test_drawFastVLine()
    Device.sleep(1000)
    test_drawFastHLine()
    Device.sleep(1000)
    test_drawRect()
    Device.sleep(1000)
    test_drawCircle()
    Device.sleep(1000)
    test_fillRect()
    Device.sleep(1000)
    test_drawTriangle()
    Device.sleep(1000)
    test_fillTriangle()
    Device.sleep(1000)
    test_drawString()
    Device.sleep(1000)
Testdemo.png


Download the repository and upload the demo code by using `rpi.py` file in repository.

How to upload pikapython demo code?

Please refer to: [ https://github.com/geeekpi/upsv6_pub/blob/main/script/pikaPython_examples/README.md ]