// Abandoned! There's no need of seeing this anymore.
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_ILI9341.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CS_PIN 10
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define TFT_DC 9
#define TFT_CS 10
Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
MD_Parola ledMatrix = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println("SSD1306 allocation failed");
while (true);
}
ledMatrix.begin();
ledMatrix.setIntensity(15);
ledMatrix.displayClear();
// For oled
delay(2000);
oled.clearDisplay();
oled.setTextSize(3);
oled.setTextColor(WHITE);
oled.setCursor(0, 10);
oled.println("My attribute");
oled.setCursor(0, 20);
oled.println("i2cAddress = 0x3c");
oled.display();
// For ILI9341 2.8" TFT-LCD Display
tft.begin();
tft.setCursor(26, 120);
tft.setTextColor(ILI9341_RED);
tft.setTextSize(3);
tft.println("Hello, TFT!");
tft.setCursor(20, 160);
tft.setTextColor(ILI9341_GREEN);
tft.setTextSize(2);
tft.println("I can has colors?");
tft.setCursor(14, 160);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.println("Thiz iz awesome!!");
}
void loop() {
// put your main code here, to run repeatedly:
ledMatrix.setTextAlignment(PA_LEFT);
ledMatrix.print("Left");
delay(2000);
ledMatrix.setTextAlignment(PA_CENTER);
ledMatrix.print("Center");
delay(2000);
ledMatrix.setTextAlignment(PA_RIGHT);
ledMatrix.print("Right");
delay(2000);
ledMatrix.setTextAlignment(PA_CENTER);
ledMatrix.setInvert(true);
ledMatrix.print("Invert");
delay(2000);
ledMatrix.setInvert(false);
ledMatrix.print(1234);
delay(2000);
}
+/-