/*
Simple "Hello World" for ILI9341 LCD
https://wokwi.com/arduino/projects/308024602434470466
*/
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include "Wire.h"
#include "LiquidCrystal_I2C.h"
#define pushLeft 3
#define pushRight 5
LiquidCrystal_I2C lcd(0x27,20,4);
// #define TFT_DC 9
// #define TFT_CS 10
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
uint8_t orang1[8] = {0x0, 0x1, 0x3, 0x2, 0x2, 0x2, 0x2, 0x2};
uint8_t orang2[8] = {0x1e, 0x13, 0x1, 0x0, 0x12, 0x12, 0x0, 0xC};
uint8_t orang3[8] = {0x0, 0x0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10};
uint8_t orang4[8] = {0x1, 0x0, 0x0, 0x7, 0x8, 0x8, 0x8, 0x8};
uint8_t orang5[8] = {0x1, 0x1e, 0xC, 0x1F, 0x0, 0x0, 0x0, 0x0};
uint8_t orang6[8] = {0x0, 0x0, 0x0, 0x18, 0x4, 0x4, 0x4, 0x4};
uint8_t orang7[8] = {0xa, 0xa, 0xa, 0xe, 0xa, 0xa, 0xb, 0x6};
uint8_t orang8[8] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0x12};
// uint8_t orang9[8] = {0x14, 0x14, 0x14, 0x1c, 0x14, 0x14, 0x14, 0x18};
// uint8_t orangg1[8] = {0x2, 0x2, 0x2, 0x2, 0x3, 0x1, 0x1, 0x7};
// uint8_t orangg2[8] = {0x12, 0x12, 0x12, 0x12, 0x13, 0x1, 0x1, 0x1};
// uint8_t orangg3[8] = {0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0, 0x18};
void printOrang(){
lcd.setCursor(0,0);
lcd.write(byte(1));
lcd.setCursor(1,0);
lcd.write(byte(2));
lcd.setCursor(2,0);
lcd.write(byte(3));
lcd.setCursor(0,1);
lcd.write(byte(4));
lcd.setCursor(1,1);
lcd.write(byte(5));
lcd.setCursor(2,1);
lcd.write(byte(6));
lcd.setCursor(0,2);
lcd.write(byte(7));
lcd.setCursor(1,2);
lcd.write(byte(8));
// lcd.setCursor(2,2);
// lcd.write(byte(9));
// lcd.setCursor(0,3);
// lcd.write(byte(10));
// lcd.setCursor(1,3);
// lcd.write(byte(11));
// lcd.setCursor(2,3);
// lcd.write(byte(12));
}
void setup() {
lcd.init();
lcd.backlight();
//cursor (horizontal, vertical)
lcd.setCursor(4,1);
lcd.print("Start the Game?");
lcd.createChar(1, orang1);
lcd.createChar(2, orang2);
lcd.createChar(3, orang3);
lcd.createChar(4, orang4);
lcd.createChar(5, orang5);
lcd.createChar(6, orang6);
lcd.createChar(7, orang7);
lcd.createChar(8, orang8);
// lcd.createChar(9, orang9);
// lcd.createChar(10, orangg1);
// lcd.createChar(11, orangg2);
// lcd.createChar(12, orangg3);
printOrang();
//sebelum write wajib setCursor
// 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?");
}
void loop() { }