TFT颜色的问题-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 455|回复: 5

[未解决] TFT颜色的问题

[复制链接]
发表于 2022-4-13 13:22 | 显示全部楼层 |阅读模式
合宙1.8“ 7735驱动,red与blue相反,如何解决。谢谢
发表于 2022-4-13 15:43 | 显示全部楼层
找卖家问一下,或者自己修改库,或者你看看你库里参数是不是错了
发表于 2022-4-13 16:03 | 显示全部楼层
 楼主| 发表于 2022-4-14 16:42 | 显示全部楼层
/*
Different hardware manufacturers use different colour order
configurations at the hardware level.  This may result in
incorrect colours being displayed.

Incorrectly displayed colours could also be the result of
using the wrong display driver in the library setup file.

Typically displays have a control register (MADCTL) that can
be used to set the Red Green Blue (RGB) colour order to RGB
or BRG so that red and blue are swapped on the display.

This control register is also used to manage the display
rotation and coordinate mirroring. The control register
typically has 8 bits, for the ILI9341 these are:

Bit Function
7   Mirror Y coordinate (row address order)
6   Mirror X coordinate (column address order)
5   Row/column exchange (for rotation)
4   Refresh direction (top to bottom or bottom to top in portrait orientation)
3   RGB order (swaps red and blue)
2   Refresh direction (top to bottom or bottom to top in landscape orientation)
1   Not used
0   Not used

The control register bits can be written with this example command sequence:

    tft.writecommand(TFT_MADCTL);
    tft.writedata(0x48);          // Bits 6 and 3 set
   
0x48 is the default value for ILI9341 (0xA8 for ESP32 M5STACK)
in rotation 0 orientation.

Another control register can be used to "invert" colours,
this swaps black and white as well as other colours (e.g.
green to magenta, red to cyan, blue to yellow).

To invert colours insert this line after tft.init() or tft.begin():

    tft.invertDisplay( invert ); // Where invert is true or false

*/
发表于 2022-4-14 17:12 | 显示全部楼层

#include <Adafruit_GFX.h>      
#include <Adafruit_ST7735.h>  

用这个库实测没问题
 楼主| 发表于 2022-4-14 17:21 | 显示全部楼层
mini 好像有问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 09:33 , Processed in 0.091758 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表