/*backlight test PWML2 = 43
Due board
Screen https://www.adafruit.com/product/1770
*/
#include <MCUFRIEND_kbv.h>
#include <TouchScreen.h>
MCUFRIEND_kbv tft;
#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
//#define LCD_RESET A4
//Touchscreen X+ X- Y+ Y- pins
#define YP A5
#define XM A4
#define YM 10
#define XP 11
//tested as correct for new ADAFRUIT screen
#define TS_MINX 150
#define TS_MINY 90
#define TS_MAXX 900
#define TS_MAXY 800
#define BLACK 0x0000
#define BLUE 0x001F
#define CYAN 0x07FF
#define DARKCYAN 0x03EF
#define GRAY1 0x8410
#define GRAY2 0x4208
#define LIGHTGREY 0xC618
#define DARKGREY 0x7BEF
#define GREEN 0x07E0
#define DARKGREEN 0x03E0
#define GREENYELLOW 0xB7E0
#define MAGENTA 0xF81F
#define MAROON 0x7800
#define NAVY 0x000F
#define OLIVE 0x7BE0
#define ORANGE 0xFDA0
#define PINK 0xFC9F
#define PURPLE 0x780F
#define RED 0xF800
#define BRIGHT_RED 0xf810
#define WHITE 0xFFFF
#define YELLOW 0xFFE0
#define MINPRESSURE 10
#define MAXPRESSURE 1000
int backlight = 43
void setup() {
Serial.begin(9600);
tft.reset();
uint16_t identifier = tft.readID();
tft.begin(identifier);
tft.setRotation(1);
pinMode(backlight, OUTPUT);
digitalWrite(backlight, 400);
}
void loop() {
// put your main code here, to run repeatedly:
}
Members
Is it possible to directly connect my ILI9341 LITE pin to the DUE’s #43 to be used as a backlight control?
The backlight has 4 white LED backlights,transistor connected.
The link for the screen is at the top of the sketch.
Thanks