// LCD1602 and Pi Pico!
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
int score = 0;
int balls = 3;
int credits = 1;
byte seven[8] = {0x1F, 0x1F, 0x1B, 0x03, 0x06, 0x0C, 0x0C, 0x0C};
byte bell[8] = {0x00, 0x04, 0x0A, 0x0E, 0x1F, 0x1F, 0x04, 0x00};
byte casinoC[8] = {0x00, 0x0F, 0x10, 0x10, 0x10, 0x10, 0x0F, 0x00};
byte casinoO[8] = {0x00, 0x0E, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x00};
byte ball[8] = {0x00, 0x0E, 0x1D, 0x1F, 0x1F, 0x0E, 0x00, 0x00};
bool slotMachineActive = 0;
bool row1 = false;
bool row2 = false;
bool row3 = false;
void setup() {
lcd.init();
lcd.backlight();
lcd.createChar(0, seven);
lcd.createChar(1, bell);
lcd.createChar(2, casinoC);
lcd.createChar(3, casinoO);
lcd.createChar(4, ball);
printInfo();
}
void loop() {
delay(10);
}
void printInfo() {
lcd.setCursor(0, 0);
lcd.print(String("Score: ") + String(score));
lcd.setCursor(0, 1);
lcd.print(String("Balls: ") + String(balls));
lcd.setCursor(0, 2);
lcd.print(String("Credits: ") + String(credits));
}
void updateScore() {
lcd.setCursor(0, 0);
lcd.print(String("Score: ") + String(score));
}
void updateBalls() {
lcd.setCursor(0, 1);
lcd.print(String("Balls: ") + String(balls));
}
void updateCredits() {
lcd.setCursor(0, 2);
lcd.print(String("Credits: ") + String(credits));
}