1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Pico-LCD-1.14の色設定はRGB565はByteスワップを考慮する必要がある

Posted at

概要

Pico-LCD-1.14をMicroPythonで使う際にWikiのサンプルコードのままだと色味がイマイチなので調整した話。

サンプルコードで定義されていた色

https://www.waveshare.com/wiki/Pico-LCD-1.14
RGB565で16bitを定義するのがだ、Wikiのサンプルではこんな感じだった。
これを見た印象では

  • Blue 5bit
  • Red 6bit
  • Green 5bit
    のように見える。
        self.red   =   0x07E0
        self.green =   0x001f
        self.blue  =   0xf800
        self.white =   0xffff

サンプルコードだとこんな感じで、赤というよりはアズキ色のような印象。
image.png

サンプルを元に色調整

「Redが6bit??」とも思ったが、とりあえず青→赤→緑の順にbitが並んでいるという前提で配色をした。
しかし思った通りの色にはなりませんでした。

原因

image.png
SPIのプロトコル的には下位Byteから先に、送出しているので、16bit単位で見るとグリーンが散らばったような感じで考える必要があるようです。

self.Green  =0xE003

調整した色設定

ということで、調整した結果、赤の発色もビビットになりました。
image.png

        #色の定義(BRG565でバイトスワップ)
        self.Lime   =0xE007
        self.Green  =0xE003
        self.Red    =0x00F8
        self.Blue   =0x1F00
        self.Navy   =0x1000
        self.Aqua   =0xFF07
        self.Purple =0xFFFB
        self.Orange =0xE0FB
        self.Yellow =0xE0FF
        self.Gold   =0xE083
        self.Magenta=0x1FF8
        self.White  =0xFFFF
        self.Black  =0x0000
        self.Gray   =0xF080

以上です

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?