Difference between revisions of "Pico-1.28-Round-LCD-HAT"

From SB-Components Wiki

Line 76: Line 76:
 
tft.init()
 
tft.init()
 
</source>
 
</source>
 +
 +
 +
==== Functions and Arguments ====
 +
* <source inline>  gc9a01.GC9A01(spi, width, height, reset, dc, cs, backlight, rotation, buffer_size) </source>
 +
required arguments:
 +
<source>
 +
`spi` spi device
 +
  `width` display width
 +
  `height` display height
 +
</source>
 +
optional args:
 +
<source>
 +
  `reset` reset pin
 +
  `dc` dc pin
 +
  `cs` cs pin
 +
  `backlight` backlight pin
 +
  `rotation` Orientation of display.
 +
  `buffer_size` 0= buffer dynamically allocated and freed as needed.
 +
 +
  Rotation | Orientation
 +
  -------- | --------------------
 +
    0    | 0 degrees
 +
    1    | 90 degrees
 +
    2    | 180 degrees
 +
    3    | 270 degrees
 +
    4    | 0 degrees mirrored
 +
    5    | 90 degrees mirrored
 +
    6    | 180 degrees mirrored
 +
    7    | 270 degrees mirrored
 +
</source>
 +
If buffer_size is specified it must be large enough to contain the largest bitmap, font character, and/or JPG used (Rows * Columns *2 bytes). Specifying a buffer_size reserves memory for use by the driver otherwise, memory required is allocated and free dynamically as it is needed. Dynamic allocation can cause heap fragmentation so garbage collection (GC) should be enabled.
  
 
== Resources ==
 
== Resources ==

Revision as of 05:30, 19 June 2021

Pico 1.28" Round LCD HAT

Pico 1.28” Round LCD HAT is a 1.28-inch display HAT with 240 x 240 resolution, 65K RGB colors, clear and colorful displaying effect, and a joystick, designed for the Raspberry Pi Pico to expand its engagement via SPI communication by providing a standard 40 pin Pico GPIO interface. The Pico 1.28" Round LCD HAT includes an integrated GC9A01 display driver and SPI interface, reducing the number of IO pins required. It features a 5-input joystick that is connected to the Pico 1.28” Round LCD HAT through a stackable GPIO connector header on the inside.

Features

  • Raspberry Pi Pico compatibility.
  • 4-wire SPI Communication.
  • Standard Raspberry Pi Pico 40 Pins GPIO.
  • 4 directions + attached band Central press button Joystick Control

  • Specifications

  • Operating Voltage - 3.3 V
  • Pixels - 240×240 resolution
  • Pixel Size - 0.135 × 0.135mm
  • Display Colour - 65K RGB
  • Display Driver - GC9A01
  • Pico 1.28 Round LCD HAT
    Buy it From : Click Here

    Pinout

    PICO 1.28" LCD HAT PICO Pins
    LCD DIN GP11
    LCD CLK GP10
    LCD DC GP8
    LCD CS GP9
    LCD RST GP12
    LCD BL GP13
    JOYSTICK UP GP18
    JOYSTICK DOWN GP20
    JOYSTICK LEFT GP21
    JOYSTICK RIGHT GP17
    JOYSTICK SELECT GP19

    Installation

    MicroPython

    • For running this HAT, you require these components :
      • Raspberry Pi Pico X 1
      • Pico 1.28" Round LCD HAT X 1
      • USB Cable X 1
    • Copy or clone code from Github.

    https://github.com/sbcshop/PICO-1.28-Round-LCD-HAT/

    • Stack Pico 1.28 Round LCD HAT with Raspberry Pi Pico, Make sure USB symbol on LCD HAT should be on the same side as of PICO USB.
    • Press and hold BOOTSEL pin of Raspberry Pi Pico and connect the USB cable, it will create a drive as RPI-RP2.
    • Now drag and drog/copy firmware.uf2 file from firmware folder to RPI-RP2 Drive. It will reboot your raspberry pi pico.
    • Open Thonny IDE and Choose interpreter as MicroPython (Raspberry Pi pico).

    Thonny-interpreter.PNG

    • Now you can run example codes from the Pico_Example_mpy folder in Thonny Ide. For example, Open the hello.py file in thonny and click on the green play button to run this example.

    Pico Round lcd HAT thonny.PNG

    It will print "Hello" on Round LCD. You can use the joystick to change the LCD color.

    Working Example

    • This module was tested on Raspberry Pi Pico. You need to provide a SPI object and the pin to use for the DC pin of the screen.
    import machine
    import gc9a01
    spi = SPI(1, baudrate=40000000, sck=Pin(10), mosi=Pin(11))
    tft = gc9a01.GC9A01(spi, 240, 240, reset=Pin(12, Pin.OUT), cs=Pin(9, Pin.OUT), dc=Pin(8, Pin.OUT), backlight=Pin(13, Pin.OUT), rotation=0)
    tft.init()


    Functions and Arguments

    • gc9a01.GC9A01(spi, width, height, reset, dc, cs, backlight, rotation, buffer_size)

    required arguments:

    `spi` spi device
      `width` display width
      `height` display height

    optional args:

    `reset` reset pin
      `dc` dc pin
      `cs` cs pin
      `backlight` backlight pin
      `rotation` Orientation of display.
      `buffer_size` 0= buffer dynamically allocated and freed as needed.
    
      Rotation | Orientation
      -------- | --------------------
         0     | 0 degrees
         1     | 90 degrees
         2     | 180 degrees
         3     | 270 degrees
         4     | 0 degrees mirrored
         5     | 90 degrees mirrored
         6     | 180 degrees mirrored
         7     | 270 degrees mirrored

    If buffer_size is specified it must be large enough to contain the largest bitmap, font character, and/or JPG used (Rows * Columns *2 bytes). Specifying a buffer_size reserves memory for use by the driver otherwise, memory required is allocated and free dynamically as it is needed. Dynamic allocation can cause heap fragmentation so garbage collection (GC) should be enabled.

    Resources