Arduino Nano 33 BLE with 1.8 inch TFT display

I've been working on image recognition on the Arduino Nano 33 BLE Sense and I got the model working. While trying to display an image from an OV7670, I noticed it was very slow but I was drawing images pixel by pixel. So, I started working on figuring out the exact problem by running a few basic codes. After some testing, here are my questions:

  1. The 5V pin is disabled by default in the Arduino board. It can be enabled by shorting the pads marked VUSB. Is it necessary to short the pads for the proper working of the display? It works fine without it.

  2. I used the code below:

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
#include <SPI.h>

  #define TFT_CS        A7
  #define TFT_RST        7 // Or set to -1 and connect to Arduino RESET pin
  #define TFT_DC         A6


Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  Serial.begin(9600);
  while (!Serial)
    delay(10);
  tft.initR(INITR_BLACKTAB);
  tft.setSPISpeed(8000000);
  delay(1000);
  tft.fillScreen(ST77XX_BLACK);
  
  
}

void loop() {
  
  testlines(ST77XX_YELLOW);
  delay(500);
  
}

void testlines(uint16_t color) {
  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(0, 0, x, tft.height()-1, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(0, 0, tft.width()-1, y, color);
    delay(0);
  }

  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(tft.width()-1, 0, x, tft.height()-1, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(tft.width()-1, 0, 0, y, color);
    delay(0);
  }

  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(0, tft.height()-1, x, 0, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(0, tft.height()-1, tft.width()-1, y, color);
    delay(0);
  }

  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(tft.width()-1, tft.height()-1, x, 0, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(tft.width()-1, tft.height()-1, 0, y, color);
    delay(0);
  }
}

The result was just white screen and the final drawn lines in a loop. I wasn't able to see the lines being drawn. Any reasons why?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.