void Pixel(int16_t x, int16_t y, uint16_t color)
__attribute__((always_inline)) {
x+=_originx;
y+=_originy;
//if((x < _displayclipx1) ||(x >= _displayclipx2) || (y < _displayclipy1) || (y >= _displayclipy2)) return;
#ifdef ENABLE_ST77XX_FRAMEBUFFER
if (_use_fbtft) {
_pfbtft[y*_screenWidth + x] = color;
return;
}
#endif
setAddr(x, y, x, y);
writecommand(ST7735_RAMWR);
writedata16(color);
}
};
if ((tabcolor == INITR_BLACKTAB) || (tabcolor == INITR_MINI160x80)) {
writedata_last(MADCTL_MX | MADCTL_MY | MADCTL_RGB);
} else {
writedata_last(MADCTL_MX | MADCTL_MY | MADCTL_BGR);
}
// This Teensy3 native optimized version requires specific pins
#define sclk 20 // SCLK can also use pin 14
#define mosi 21 // MOSI can also use pin 7
#define cs 2 // CS & DC can use pins 2, 6, 9, 10, 15, 20, 21, 22, 23
#define dc 3 //but certain pairs must NOT be used: 2+10, 6+9, 20+23, 21+22
#define rst 8 // RST can use any pin
#include <Adafruit_GFX.h>
#include <ST7735_t3.h> // Hardware-specific library for T3.x
#include "Fonts/FreeSansBold18pt7b.h"
ST7735_t3 tft = ST7735_t3(cs, dc, mosi, sclk, rst);
void setup() {
// tft.useFrameBuffer(true);
tft.initR(INITR_MINI160x80);
tft.setRotation(3);
tft.invertDisplay(true);
tft.fillScreen(ST7735_BLACK);
tft.setFont(&FreeSansBold18pt7b);
tft.setCursor(53, 10);
tft.setTextColor(ST7735_YELLOW);
tft.println("999");
tft.drawLine(20, 50, 20, 80, ST7735_RED);
tft.drawLine(0, 0, 60, 80, ST7735_BLUE);
tft.drawLine(20, 50, 60, 50, ST7735_GREEN);
// tft.updateScreen();
}
void loop() {
}
_colstart = 24;
_rowstart = 0;
void setup() {
// tft.useFrameBuffer(true);
tft.initR(INITR_MINI160x80);
tft.setRowColStart(0,0); // try tweaking for your display
tft.setRotation(3);
//tft.invertDisplay(true);
tft.fillScreen(ST7735_BLACK);
Are versions of ST7735_t3 archived anywhere on the site for dl? (I did look, but did not find any)
In case no. I just deleted my old repository in favor of using a forked copy of the TD version. @KurtE may have some old version laying around.
BTW: When I ran the sketch I saw the color issue that you are seeing. I deleted the invertDisplay line and colors printed correctly.
I can not seem to duplicate the issue with the framebuffer that you are seeing.
// This Teensy3 native optimized version requires specific pins
#define sclk 20 // SCLK can also use pin 14
#define mosi 21 // MOSI can also use pin 7
#define cs 2 // CS & DC can use pins 2, 6, 9, 10, 15, 20, 21, 22, 23
#define dc 3 //but certain pairs must NOT be used: 2+10, 6+9, 20+23, 21+22
#define rst 8 // RST can use any pin
#include <Adafruit_GFX.h>
#include <ST7735_t3.h> // Hardware-specific library for T3.x
#include "Fonts/FreeSansBold18pt7b.h"
ST7735_t3 tft = ST7735_t3(cs, dc, mosi, sclk, rst);
void setup() {
// tft.useFrameBuffer(true);
tft.initR(INITR_MINI160x80);
tft.setRowColStart(10, 26); // Row has NO effect whatever you set
tft.setRotation(3);
// tft.invertDisplay(true);
tft.fillScreen(ST7735_BLACK);
tft.setFont(&FreeSansBold18pt7b);
tft.setCursor(40, 30);
tft.setTextColor(ST7735_YELLOW);
tft.println("9 9 9");
tft.drawLine(1, 1, 1, 80, ST7735_RED);//left vertical
tft.drawLine(160, 1, 160, 80, ST7735_MAGENTA);//right vertical - DOESN'T appear
tft.drawLine(1, 1, 160, 1, ST7735_BLUE);//top horizontal
tft.drawLine(1, 80, 160, 80, ST7735_YELLOW);//bottom horizontal - DOESN'T appear
tft.drawLine(1, 1, 160, 80, ST7735_GREEN);//diagonal across whole screen
// tft.updateScreen();
}
void loop() {
}
Don't get me wrong, I really am not whining. I read an older thread (here) on this controller and it is a royal pain. For my 2 cents, making new "tab" versions is probably not the way to go. Colored tabs, while meaningful at one time and in one place, might have made sense, I don't think they do now. For example, see https://forum.arduino.cc/index.php?topic=397984.0 with a popular display - he went to a GREENTAB2 setting...what's next - 3,4 and 5 versions of different tab colors?
In any event, i do appreciate the efforts that you folks are putting into it.
tft.drawLine(0, 0, 0, 79, ST7735_RED);//left vertical
tft.drawLine(159, 0, 159, 79, ST7735_MAGENTA);//right vertical - DOESN'T appear
tft.drawLine(0, 0, 159, 0, ST7735_BLUE);//top horizontal
tft.drawLine(0, 79, 159, 79, ST7735_YELLOW);//bottom horizontal - DOESN'T appear
tft.drawLine(0, 0, 159, 79, ST7735_GREEN);//diagonal across whole screen
// This Teensy3 native optimized version requires specific pins
#define sclk 13 // SCLK can also use pin 14
#define mosi 11 // MOSI can also use pin 7
#define cs 10 // CS & DC can use pins 2, 6, 9, 10, 15, 20, 21, 22, 23
#define dc 8 //but certain pairs must NOT be used: 2+10, 6+9, 20+23, 21+22
#define rst -1 // RST can use any pin
#define BL_PIN 7
#include <Adafruit_GFX.h>
#include <ST7735_t3.h> // Hardware-specific library for T3.x
#include "Fonts/FreeSansBold18pt7b.h"
ST7735_t3 tft = ST7735_t3(cs, dc);
void setup() {
// tft.useFrameBuffer(true);
while (!Serial && millis() < 4000) ;
Serial.begin(115200);
Serial.println("setup");
#ifdef BL_PIN
pinMode(BL_PIN, OUTPUT);
digitalWriteFast(BL_PIN, LOW);
delay(100);
digitalWriteFast(BL_PIN, HIGH);
#endif
tft.initR(INITR_MINI160x80_ST7735S);
//tft.initR(INITR_GREENTAB);
Serial.println("After INITR");
tft.setRotation(1);
tft.fillScreen(ST7735_BLACK);
Serial.println("After black screen");
delay(500);
tft.fillScreen(ST7735_GREEN);
Serial.println("After green screen");
delay(500);
tft.fillScreen(ST7735_RED);
Serial.println("After RED screen");
delay(500);
tft.fillScreen(ST7735_BLUE);
Serial.println("After BLUE screen");
delay(500);
tft.fillScreen(ST7735_BLACK);
Serial.println("After black screen");
delay(500);
tft.setFont(&FreeSansBold18pt7b);
tft.setCursor(40, 30);
tft.setTextColor(ST7735_YELLOW);
tft.println("9 9 9");
tft.drawLine(0, 0, 0, 79, ST7735_RED);//left vertical
tft.drawLine(159, 0, 159, 79, ST7735_MAGENTA);//right vertical - DOESN'T appear
tft.drawLine(0, 0, 159, 0, ST7735_BLUE);//top horizontal
tft.drawLine(0, 79, 159, 79, ST7735_YELLOW);//bottom horizontal - DOESN'T appear
tft.drawLine(0, 0, 159, 79, ST7735_GREEN);//diagonal across whole screen
// tft.updateScreen();
}
void loop() {
}