adafruit / Adafruit_HX8357_Library

Arduino library for HX8357
43 stars 37 forks source link

Problem with SPI pin assignments on Challenger RP2040 LTE #44

Open fordsman opened 10 months ago

fordsman commented 10 months ago

Only white display in Aurdino but works in CircutPython if i remap the MISO pin "spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=microcontroller.pin.GPIO20 )"

This is the Aurdino code i try:


#include <Adafruit_GFX.h>
#include <Adafruit_HX8357.h>

#define TFT_CS   9
#define TFT_DC   10
#define TFT_RST  -1 // Set TFT_RST to -1 if not used

Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC, 20, 22, TFT_RST, 23);

void setup() {
Serial.begin(115200);
while (!Serial);  

Serial.println("3.5\" HX8357D FeatherWing Test!"); 

tft.begin();
delay(500);

  // read diagnostics (optional but can help debug problems)
uint8_t x = tft.readcommand8(HX8357_RDPOWMODE);
Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
x = tft.readcommand8(HX8357_RDMADCTL);
Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
x = tft.readcommand8(HX8357_RDCOLMOD);
Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
x = tft.readcommand8(HX8357_RDDIM);
Serial.print("Image Format: 0x"); Serial.println(x, HEX);
x = tft.readcommand8(HX8357_RDDSDR);
Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX); 

tft.setRotation(1); // Adjust the rotation as needed (0, 1, 2, 3)
tft.fillScreen(HX8357_BLACK);
tft.setTextColor(HX8357_WHITE);
tft.setTextSize(2);

tft.setCursor(50, 100); // Adjust the cursor position as needed
tft.println("Now it is working!");

}

void loop() { delay(1000); }


White display and zero(0) on all diagnostic values when using Challenger RP2040 LTE Full function and proper diagnostic values when try with a Adafruit feather M4