I have a tft display (1.8") and a relay connected to an arduino nano. the relay is connected to pin 12, where it is activated when the pin is LOW.
The following code works, setting pin 12 to 0V in the loop, and activating the relay:
// TFT DISPLAY //
#include <SPI.h>
#include "Adafruit_GFX.h" // Core graphics library
#include "Adafruit_QDTech.h" // Hardware-specific library
#define sclk 13 // Don't change
#define mosi 11 // Don't change
#define cs 9
#define dc 8
#define rst 7 // you can also connect this to the Arduino reset
Adafruit_QDTech tft = Adafruit_QDTech(cs, dc, rst); // Display-Bibliothek Setup
// RELAY
int relay = 12;
void setup() {
// RELAY: initialize the digital pin as an output.
pinMode(relay, OUTPUT);
//Display Setup
// tft.init();
}
void loop() {
digitalWrite(relay, LOW);
}
However, if I activate the display (uncomment tft.init();), pin 12 shows 3,7V in LOW and 4.4 in HIGH.
Is this a software problem?
Thanks in advance!