#include "Vector.hpp"
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <Wire.h>
#include <Adafruit_FT6206.h>
Adafruit_ILI9341 screen = Adafruit_ILI9341(10,11,12,9);
Adafruit_FT6206 touch = Adafruit_FT6206();
struct Color {
byte r;
byte g;
byte b;
};
#define newColor ((Color*) malloc(sizeof(Color)))
// test color vectors
//auto colors = new Vector<Color>;
Color red = {.r=255,.g=0,.b=0};
//colors->Append(red);
void setup() {
Wire.begin();
screen.begin();
Serial.begin(9600);
Wire.setSDA(14);
Wire.setSCL(15);
if (!touch.begin()) {
Serial.println("failed to initalize FT6206");
// while (1);
}
// put your setup code here, to run once:
//red->r = 255;
//red->g = 0;
//red->b = 0;
//colors->Append(red);
//Serial1.begin(115200);
Color mycolor = red;
// Serial1.print("r:" + (char) mycolor.r);
screen.setTextColor(toColor(red));
screen.println("Hello, Raspberry Pi Pico W!");
}
void loop() {
// put your main code here, to run repeatedly:
delay(1); // this speeds up the simulation
}
int16_t toColor(Color color) {
return screen.color565(color.r,color.g,color.b);
}
int16_t toColor(Color* color) {
return screen.color565(color->r,color->g,color->b);
}
Loading
ili9341-cap-touch
ili9341-cap-touch