#include <stdlib.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 ekran(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// 'sifir', 21x21px
const unsigned char sifir [] PROGMEM = {
0x00, 0x00, 0x00, 0x1f, 0xff, 0x80, 0x1f, 0xff, 0x80, 0x78, 0x01, 0xe0, 0x78, 0x01, 0xe0, 0x61,
0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8,
0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x78, 0x01, 0xf8,
0x78, 0x01, 0xf8, 0x1f, 0xff, 0xf8, 0x1f, 0xff, 0xf8, 0x07, 0xff, 0xe0, 0x07, 0xff, 0xe0
};
// 'bir', 21x21px
const unsigned char bir [] PROGMEM = {
0x00, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x01, 0xfe, 0x00, 0x07, 0x87, 0x80, 0x07, 0x87, 0x80, 0x06,
0x07, 0x80, 0x06, 0x07, 0x80, 0x07, 0x87, 0x80, 0x07, 0x87, 0x80, 0x01, 0x87, 0x80, 0x01, 0x87,
0x80, 0x01, 0x87, 0x80, 0x01, 0x87, 0x80, 0x1f, 0x87, 0xe0, 0x1f, 0x87, 0xe0, 0x18, 0x00, 0x78,
0x18, 0x00, 0x78, 0x1f, 0xff, 0xf8, 0x1f, 0xff, 0xf8, 0x07, 0xff, 0xf8, 0x07, 0xff, 0xf8
};
// 'iki', 21x21px
const unsigned char iki [] PROGMEM = {
0x00, 0x00, 0x00, 0x1f, 0xff, 0x80, 0x1f, 0xff, 0x80, 0x78, 0x01, 0xe0, 0x78, 0x01, 0xe0, 0x61,
0xf8, 0x78, 0x61, 0xf8, 0x78, 0x7f, 0xe1, 0xf8, 0x7f, 0xe1, 0xf8, 0x1e, 0x07, 0xf8, 0x1e, 0x07,
0xf8, 0x78, 0x7f, 0xe0, 0x78, 0x7f, 0xe0, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x60, 0x00, 0x78,
0x60, 0x00, 0x78, 0x7f, 0xff, 0xf8, 0x7f, 0xff, 0xf8, 0x0f, 0xff, 0xf8, 0x0f, 0xff, 0xf8
};
// 'uc', 21x21px
const unsigned char uc [] PROGMEM = {
0x00, 0x00, 0x00, 0x1f, 0xff, 0x80, 0x1f, 0xff, 0x80, 0x78, 0x01, 0xe0, 0x78, 0x01, 0xe0, 0x61,
0xf8, 0x78, 0x61, 0xf8, 0x78, 0x7f, 0xf8, 0x78, 0x7f, 0xf8, 0x78, 0x1e, 0x01, 0xf8, 0x1e, 0x01,
0xf8, 0x7f, 0xf8, 0x78, 0x7f, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x78, 0x01, 0xf8,
0x78, 0x01, 0xf8, 0x1f, 0xff, 0xf8, 0x1f, 0xff, 0xf8, 0x07, 0xff, 0xe0, 0x07, 0xff, 0xe0
};
// 'dort', 21x21px
const unsigned char dort [] PROGMEM = {
0x00, 0x00, 0x00, 0x01, 0xff, 0x80, 0x01, 0xff, 0x80, 0x07, 0x81, 0xe0, 0x07, 0x81, 0xe0, 0x1e,
0x01, 0xe0, 0x1e, 0x01, 0xe0, 0x78, 0x61, 0xe0, 0x78, 0x61, 0xe0, 0x61, 0xe1, 0xe0, 0x61, 0xe1,
0xe0, 0x60, 0x00, 0x78, 0x60, 0x00, 0x78, 0x7f, 0xe1, 0xf8, 0x7f, 0xe1, 0xf8, 0x1f, 0xe1, 0xf8,
0x1f, 0xe1, 0xf8, 0x00, 0x7f, 0xe0, 0x00, 0x7f, 0xe0, 0x00, 0x1f, 0xe0, 0x00, 0x1f, 0xe0
};
// 'bes', 21x21px
const unsigned char bes [] PROGMEM = {
0x00, 0x00, 0x00, 0x7f, 0xff, 0x80, 0x7f, 0xff, 0x80, 0x60, 0x01, 0xe0, 0x60, 0x01, 0xe0, 0x67,
0xff, 0xe0, 0x67, 0xff, 0xe0, 0x60, 0x01, 0xe0, 0x60, 0x01, 0xe0, 0x7f, 0xf8, 0x78, 0x7f, 0xf8,
0x78, 0x7f, 0xf8, 0x78, 0x7f, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x78, 0x01, 0xf8,
0x78, 0x01, 0xf8, 0x1f, 0xff, 0xf8, 0x1f, 0xff, 0xf8, 0x07, 0xff, 0xe0, 0x07, 0xff, 0xe0
};
// 'alti', 21x21px
const unsigned char alti [] PROGMEM = {
0x00, 0x00, 0x00, 0x1f, 0xff, 0x80, 0x1f, 0xff, 0x80, 0x78, 0x01, 0xe0, 0x78, 0x01, 0xe0, 0x61,
0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xff, 0xf8, 0x61, 0xff, 0xf8, 0x60, 0x00, 0x78, 0x60, 0x00,
0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x78, 0x01, 0xf8,
0x78, 0x01, 0xf8, 0x1f, 0xff, 0xf8, 0x1f, 0xff, 0xf8, 0x07, 0xff, 0xe0, 0x07, 0xff, 0xe0
};
// 'yedi', 21x21px
const unsigned char yedi [] PROGMEM = {
0x00, 0x00, 0x00, 0x1f, 0xff, 0xe0, 0x1f, 0xff, 0xe0, 0x78, 0x00, 0x78, 0x78, 0x00, 0x78, 0x61,
0xf8, 0x78, 0x61, 0xf8, 0x78, 0x7f, 0xe1, 0xf8, 0x7f, 0xe1, 0xf8, 0x07, 0x87, 0xf8, 0x07, 0x87,
0xf8, 0x06, 0x1f, 0xe0, 0x06, 0x1f, 0xe0, 0x06, 0x1f, 0x80, 0x06, 0x1f, 0x80, 0x06, 0x1e, 0x00,
0x06, 0x1e, 0x00, 0x07, 0xfe, 0x00, 0x07, 0xfe, 0x00, 0x01, 0xfe, 0x00, 0x01, 0xfe, 0x00
};
// 'sekiz', 21x21px
const unsigned char sekiz [] PROGMEM = {
0x00, 0x00, 0x00, 0x1f, 0xff, 0x80, 0x1f, 0xff, 0x80, 0x78, 0x01, 0xe0, 0x78, 0x01, 0xe0, 0x61,
0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x78, 0x01, 0xf8, 0x78, 0x01,
0xf8, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x78, 0x01, 0xf8,
0x78, 0x01, 0xf8, 0x1f, 0xff, 0xf8, 0x1f, 0xff, 0xf8, 0x07, 0xff, 0xe0, 0x07, 0xff, 0xe0
};
// 'dokuz', 21x21px
const unsigned char dokuz [] PROGMEM = {
0x00, 0x00, 0x00, 0x1f, 0xff, 0x80, 0x1f, 0xff, 0x80, 0x78, 0x01, 0xe0, 0x78, 0x01, 0xe0, 0x61,
0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x60, 0x00, 0x78, 0x60, 0x00,
0x78, 0x7f, 0xf8, 0x78, 0x7f, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x61, 0xf8, 0x78, 0x78, 0x01, 0xf8,
0x78, 0x01, 0xf8, 0x1f, 0xff, 0xf8, 0x1f, 0xff, 0xf8, 0x07, 0xff, 0xe0, 0x07, 0xff, 0xe0
};
const unsigned char* sayilar[10] = {
sifir,
bir,
iki,
uc,
dort,
bes,
alti,
yedi,
sekiz,
dokuz
};
// 'BaslaBos', 64x32px
const unsigned char Basla [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0xc7, 0xf3, 0xc0, 0xfe, 0x00,
0x00, 0x81, 0xb0, 0x6c, 0x1a, 0x61, 0x83, 0x00, 0x00, 0x9c, 0xe7, 0x39, 0xce, 0x63, 0x39, 0x80,
0x00, 0x9c, 0xe7, 0x39, 0xfe, 0x63, 0x39, 0x80, 0x00, 0x81, 0xe7, 0x3c, 0x1e, 0x63, 0x39, 0x80,
0x00, 0x9c, 0xe0, 0x3f, 0xce, 0x63, 0x01, 0x80, 0x00, 0x9c, 0xe7, 0x39, 0xce, 0x7f, 0x39, 0x80,
0x00, 0x81, 0xe7, 0x3c, 0x9f, 0x07, 0x39, 0x80, 0x00, 0xff, 0xff, 0xf7, 0xfd, 0xff, 0xff, 0x80,
0x00, 0x7f, 0x9f, 0xf3, 0x78, 0xfe, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'BaslaSecildi', 64x32px
const unsigned char BaslaSecildi [] PROGMEM = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xe0, 0x38, 0x0c, 0x3f, 0x01, 0xff,
0xff, 0x7e, 0x4f, 0x93, 0xe5, 0x9e, 0x7c, 0xff, 0xff, 0x63, 0x18, 0xc6, 0x31, 0x9c, 0xc6, 0x7f,
0xff, 0x63, 0x18, 0xc6, 0x01, 0x9c, 0xc6, 0x7f, 0xff, 0x7e, 0x18, 0xc3, 0xe1, 0x9c, 0xc6, 0x7f,
0xff, 0x63, 0x1f, 0xc0, 0x31, 0x9c, 0xfe, 0x7f, 0xff, 0x63, 0x18, 0xc6, 0x31, 0x80, 0xc6, 0x7f,
0xff, 0x7e, 0x18, 0xc3, 0x60, 0xf8, 0xc6, 0x7f, 0xff, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x7f,
0xff, 0x80, 0x60, 0x0c, 0x87, 0x01, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
// 'ustTasarim', 64x32px
const unsigned char ustTasarim [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1f, 0xe7, 0xf8, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x34, 0x0c, 0xc6, 0x00, 0x00, 0x00,
0x00, 0x13, 0x9c, 0xe7, 0x93, 0x00, 0x00, 0x00, 0x00, 0x13, 0x9c, 0xe7, 0x39, 0x80, 0x00, 0x00,
0x00, 0x13, 0x9c, 0xc7, 0x39, 0x80, 0x00, 0x00, 0x00, 0x10, 0x3c, 0x1f, 0x39, 0x80, 0x00, 0x00,
0x00, 0x13, 0xfc, 0xcf, 0x93, 0x8f, 0xe0, 0x00, 0x00, 0x13, 0xf4, 0xe6, 0xc7, 0x98, 0x30, 0x00,
0x00, 0x1f, 0x07, 0xfe, 0x7f, 0x13, 0x98, 0x00, 0x00, 0x0f, 0x03, 0xde, 0x3e, 0x1f, 0x38, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x78, 0x00, 0x00, 0x0f, 0x01, 0xfd, 0xfe, 0x19, 0xf0, 0x00,
0x00, 0x09, 0x83, 0x07, 0x03, 0x13, 0x98, 0x00, 0x00, 0x09, 0x82, 0x73, 0x39, 0x90, 0x18, 0x00,
0x00, 0x09, 0x82, 0x73, 0x39, 0x9f, 0xf8, 0x00, 0x00, 0x09, 0x82, 0x73, 0x03, 0x8f, 0xf8, 0x00,
0x00, 0x09, 0x82, 0x03, 0x39, 0x80, 0x00, 0x00, 0x00, 0x09, 0xfa, 0x73, 0x39, 0x80, 0x00, 0x00,
0x00, 0x0c, 0x0e, 0x73, 0x03, 0x80, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00,
0x00, 0x03, 0xfb, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'cikis', 64x32px
const unsigned char cikis [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xfe, 0xff, 0x7f, 0x00, 0x00,
0x00, 0x01, 0x87, 0x33, 0x99, 0xc1, 0x80, 0x00, 0x00, 0x03, 0x33, 0x33, 0x39, 0x9c, 0xc0, 0x00,
0x00, 0x02, 0x7f, 0x32, 0x79, 0x9f, 0xc0, 0x00, 0x00, 0x02, 0x7f, 0x30, 0xf9, 0xc1, 0xc0, 0x00,
0x00, 0x02, 0x7f, 0x32, 0x79, 0xfc, 0xc0, 0x00, 0x00, 0x03, 0x33, 0x33, 0x39, 0x9c, 0xc0, 0x00,
0x00, 0x01, 0x87, 0x33, 0x99, 0xc1, 0xc0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
0x00, 0x00, 0x4e, 0xff, 0x7f, 0xb3, 0x80, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x0c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'cikisSecildi', 64x32px
const unsigned char cikisSecildi [] PROGMEM = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x04, 0x02, 0x01, 0x01, 0xff, 0xff,
0xff, 0xfc, 0xf1, 0x98, 0xcc, 0x7c, 0xff, 0xff, 0xff, 0xf9, 0x99, 0x99, 0x8c, 0xc6, 0x7f, 0xff,
0xff, 0xfb, 0x01, 0x9b, 0x0c, 0xc0, 0x7f, 0xff, 0xff, 0xfb, 0x01, 0x9e, 0x0c, 0x7c, 0x7f, 0xff,
0xff, 0xfb, 0x01, 0x9b, 0x0c, 0x06, 0x7f, 0xff, 0xff, 0xf9, 0x99, 0x99, 0x8c, 0xc6, 0x7f, 0xff,
0xff, 0xfc, 0xf1, 0x98, 0xcc, 0x7c, 0x7f, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff,
0xff, 0xff, 0x62, 0x01, 0x00, 0x98, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xe7, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
// 'cikisYazisi', 64x128px
const unsigned char cikisYazisi [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x19, 0x52, 0x94, 0xb6, 0x97, 0x70, 0x00, 0x00, 0x25, 0xd2, 0xd4, 0xaa, 0x91, 0x50, 0x00,
0x00, 0x24, 0x52, 0xb4, 0xa2, 0x92, 0x70, 0x00, 0x00, 0x19, 0x8c, 0x93, 0x22, 0x67, 0x50, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0xe6, 0x77, 0x7b, 0x32, 0xea, 0x57, 0x00, 0x01, 0x09, 0x42, 0x72, 0xa8, 0x83, 0x41, 0x00,
0x01, 0x29, 0x72, 0x43, 0x2a, 0xaa, 0xd2, 0x00, 0x01, 0xe6, 0x32, 0x7a, 0xb2, 0xea, 0x57, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x28, 0xe8, 0x5d, 0x48, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80, 0x10, 0x68, 0x00, 0x00,
0x00, 0x00, 0x28, 0xa8, 0x51, 0x58, 0x00, 0x00, 0x00, 0x00, 0x2e, 0xe8, 0x5d, 0x48, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0xbb, 0xd5, 0x55, 0x91, 0xec, 0x00,
0x00, 0x27, 0x23, 0x99, 0x81, 0x51, 0xca, 0x00, 0x00, 0x24, 0x3a, 0x15, 0x55, 0x91, 0x0c, 0x00,
0x00, 0x27, 0x9b, 0xd5, 0x5d, 0x5d, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const unsigned char* cizimler[5] = {
Basla,
BaslaSecildi,
cikis,
cikisSecildi,
cikisYazisi,
};
const unsigned char tuglaciz [] PROGMEM = {
0xff, 0xf0, 0xff, 0x10, 0xff, 0xd0, 0xbf, 0xf0, 0x8f, 0xf0, 0xff, 0xf0
};
const unsigned char topciz [] PROGMEM = {
0xc0, 0xc0
};
const unsigned char taban [] PROGMEM = {
0xff, 0xf0, 0xff, 0xf0
};
const unsigned char canciz [] PROGMEM = {
0x40, 0xe0, 0x40
};
const unsigned char* resimler[4] = {
tuglaciz,
topciz,
taban,
canciz
};
int baslangic[5][5] = {{0,1,0,1,0}, {1,0,1,0,1}, {0,1,0,1,0}, {1,0,1,0,1}, {0,1,0,1,0}};
int baklava[5][5] = {{0,0,1,0,0}, {0,1,1,1,0}, {1,1,1,1,1}, {0,1,1,1,0}, {0,0,1,0,0}};
int carpi[5][5] = {{1,0,0,0,1}, {0,1,0,1,0}, {0,0,1,0,0}, {0,1,0,1,0}, {1,0,0,0,1}};
int spiral[5][5] = {{1,1,1,1,1}, {1,0,0,0,1}, {1,0,1,0,1}, {1,0,1,0,1}, {1,0,1,1,1}};
volatile boolean objegeldi;
volatile boolean baslangicekrani, oyunekrani, cikisekrani, puanekrani, yeniseviye, yeniBasladi;
volatile boolean sagbasildi, solbasildi, okbasildi;
volatile boolean sagcekildi, solcekildi, okcekildi;
int temp = 0 ;
int x = 0;
int y = 0;
int objeindex = 0;
int simdikiZaman = 0, oncekiZaman = 0, vurulanSayisi = 0;
int cubukx = 0, cubuky = 0, framesuresi = 5, satir = 5, sutun = 5;
int topx = 0, topy = 0, objex = 0, objey = 0, dokunulmazlikSaniye = 0;
int canSayisi = 3, score = 0, xDegisim = -1, yDegisim = -1, seviye = 0;
int ekranKontrol[5][5];
int objeKontrol[60][3];
int birlera = 27;
int birlerb = 26;
int birlerc = 23;
int birlerd = 24;
int birlere = 25;
int birlerf = 28;
int birlerg = 29;
void setup() {
Serial.begin(9600);
restart();
pinMode(49, INPUT);
pinMode(51, INPUT);
pinMode(53, INPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
if(!ekran.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
ekran.setRotation(3);
ekran.clearDisplay();
}
void loop() {
sol();
sag();
sec();
if(baslangicekrani) baslangicEkrani();
if(cikisekrani) cikisEkrani();
if(oyunekrani) oyunEkrani();
}
void butonSifirla(){
//butonlar sifirlandi
sagbasildi = sagcekildi = false;
solbasildi = solcekildi = false;
okbasildi = okcekildi = false;
}
void restart(){
if(!yeniseviye){
baslangicekrani = true;
oyunekrani = false;
canSayisi = 3;
score = seviye = 0;
}
else{
ekranGuncelle();
}
butonSifirla();
//oyun baslangic ekranindan baslayacak
cikisekrani = false;
yeniBasladi = true;
yeniseviye = false;
puanekrani = false;
objegeldi = false;
objeindex = vurulanSayisi = 0;
for(int i=0; i<satir*sutun; i++){
objeKontrol[i][0] = 0;
objeKontrol[i][1] = 0;
objeKontrol[i][2] = 0;
}
}
void sec(){
if(digitalRead(51)){
okbasildi = true;
}
if(!digitalRead(51) && okbasildi){
okcekildi = true;
}
if(okbasildi && okcekildi && baslangicekrani && y == 0){
butonSifirla();
baslangicekrani = false;
oyunekrani = true;
}
if(okbasildi && okcekildi && baslangicekrani && y == 1){
butonSifirla();
baslangicekrani = false;
cikisekrani = true;
}
}
void sag(){
if(digitalRead(53)){
sagbasildi = true;
}
if(!digitalRead(53) && sagbasildi){
sagcekildi = true;
}
if(sagbasildi && sagcekildi){
y = 1;
butonSifirla();
}
}
void sol(){
if(digitalRead(49)){
solbasildi = true;
}
if(!digitalRead(49) && solbasildi){
solcekildi = true;
}
if(solbasildi && solcekildi){
y = 0;
butonSifirla();
}
}
void cikisEkrani(){
ekran.drawBitmap(0, 0, cizimler[4], 64, 128, WHITE);
ekran.display();
ekran.clearDisplay();
delay(5000);
restart();
}
void baslangicEkrani(){
if(y == 0){
ekran.drawBitmap(0, 32, cizimler[1], 64, 32, WHITE);
ekran.drawBitmap(0, 64, cizimler[2], 64, 32, WHITE);
}
if(y == 1){
ekran.drawBitmap(0, 32, cizimler[0], 64, 32, WHITE);
ekran.drawBitmap(0, 64, cizimler[3], 64, 32, WHITE);
}
ekran.display();
ekran.clearDisplay();
}
void oyunEkrani(){
for(int i = 0; i < canSayisi; i++){
if(i == 0){
digitalWrite(11, HIGH);
digitalWrite(12, LOW);
digitalWrite(13, LOW);
}
if(i == 1){
digitalWrite(12, HIGH);
digitalWrite(13, LOW);
}
if(i == 2) digitalWrite(13, HIGH);
}
if(canSayisi == 0){
digitalWrite(11, LOW);
digitalWrite(12, LOW);
digitalWrite(13, LOW);
puanEkrani();
delay(5000);
restart();
ekranGuncelle();
}
cubukx = map(analogRead(A7), 0, 1023, 0, 7)*10;
if(cubukx > 52) cubukx = 52;
cubuky = 125;
ekran.drawBitmap(cubukx, cubuky, resimler[2], 12, 2, WHITE);
if(yeniBasladi){
topx = cubukx+2;
topy = cubuky-2;
yeniBasladi = false;
}
ekran.drawBitmap(topx, topy, resimler[1], 2, 2, WHITE);
for(int i=0; i<satir; i++){
for(int j=0; j<sutun; j++){
if(ekranKontrol[i][j] == 1){
ekran.drawBitmap(j*13, i*7, resimler[0], 12, 6, WHITE);
}
}
}
simdikiZaman = millis();
if(simdikiZaman - oncekiZaman >= framesuresi){
topHareket();
if(topy <= 90) tuglayaCarptiMi();
topDustuMu();
objeAlindiMi();
topx += xDegisim;
topy += yDegisim;
oncekiZaman = simdikiZaman;
if(objegeldi){
for(int i=0; i<satir*sutun; i++){
if(objeKontrol[i][0] == 1){
ekran.drawBitmap(objeKontrol[i][1], objeKontrol[i][2], resimler[3], 3, 3, WHITE);
objeKontrol[i][2]+=1;
}
}
}
vurulanSayisi = 0;
for(int i=0; i<satir; i++){
for(int j=0; j<sutun; j++){
if(ekranKontrol[i][j] == 0){
vurulanSayisi++;
}
}
}
yeniseviye = (vurulanSayisi == satir*sutun) ? true : false;
if(yeniseviye){
framesuresi -= framesuresi/5;
geriSayim();
restart();
}
}
showScore(score % 10, 0);
showScore((score/10) % 10, 1);
ekran.display();
ekran.clearDisplay();
}
void topHareket(){
//top en altta
if(topy == 123 && yDegisim > 0 && topx+2 >= cubukx && topx <= cubukx+12){
yDegisim = -1;
}
if(topy == 0 && yDegisim < 0){
yDegisim = 1;
}
if(topx == 0 && xDegisim < 0){
xDegisim = 1;
}
if(topx == 62 && xDegisim > 0){
xDegisim = -1;
}
}
void objeAlindiMi(){
for(int i=0; i<60; i++){
if(objeKontrol[i][0] == 1 && objeKontrol[i][1]+2 >= cubukx && objeKontrol[i][1] <= cubukx+12 && objeKontrol[i][2] == 122){
canSayisi += (canSayisi < 3) ? 1 : 0;
}
}
}
void tuglayaCarptiMi(){
if((topy+1)/7-1 < satir && (topy+1) % 7 == 0 && ekranKontrol[(topy+1)/7-1][topx/13] == 1){
ekranKontrol[(topy+1)/7-1][topx/13] = 0;
yDegisim *= -1;
score++;
item((topx/13), (topy-6)/7, millis()%10);
}
if((topy+2)/7 < satir && (topy+2) % 7 == 0 && ekranKontrol[(topy+2)/7][topx/13] == 1){
ekranKontrol[(topy+2)/7][topx/13] = 0;
yDegisim *= -1;
score++;
item((topx/13), (topy+2)/7, millis()%10);
}
if(topy/7 < satir && (topx+2) % 13 == 0 && ekranKontrol[topy/7][(topx+2)/13] == 1){
ekranKontrol[topy/7][(topx+2)/13] = 0;
xDegisim *= -1;
score++;
item((topx+2)/13, topy/7, millis()%10);
}
if(topy/7 < satir && (topx-12) % 13 == 0 && ekranKontrol[topy/7][(topx-12)/13] == 1){
ekranKontrol[topy/7][(topx-12)/13] = 0;
xDegisim *= -1;
score++;
item((topx-12)/13, topy/7, millis()%10);
}
}
void item(int x, int y, int sans){
for(int i=0; i<satir*sutun; i++){
objegeldi = false;
if(objeKontrol[i][0]==1 && objeKontrol[i][2] < 128){
objegeldi = true;
}
}
if(sans == 5){
objegeldi = true;
objeKontrol[objeindex][0] = 1;
objeKontrol[objeindex][1] = x*13+5;
objeKontrol[objeindex][2] = y*7+3;
objeindex++;
}
}
void geriSayim(){
ekran.drawBitmap(21, 50, sayilar[3], 21, 21, WHITE);
ekran.display();
ekran.clearDisplay();
delay(1000);
ekran.drawBitmap(21, 50, sayilar[2], 21, 21, WHITE);
ekran.display();
ekran.clearDisplay();
delay(1000);
ekran.drawBitmap(0,0, sayilar[1], 16, 16, WHITE);
ekran.display();
ekran.clearDisplay();
delay(1000);
}
void topDustuMu(){
if(topy >= 128){
canSayisi -= 1;
delay(500);
topx = cubukx+2;
topy = cubuky-2;
xDegisim = 1;
yDegisim = -1;
}
}
void puanEkrani(){
ekran.drawBitmap(15, 50, sayilar[score/100], 21, 21, WHITE);
ekran.drawBitmap(36, 50, sayilar[score%10], 21, 21, WHITE);
ekran.display();
ekran.clearDisplay();
}
void ekranGuncelle(){
int temp = 0;
for(int i=0; i<5; i++){
for(int j=0; j<5; j++){
switch(seviye){
case 0 : temp = baslangic[i][j]; break;
case 1 : temp = baklava[i][j]; break;
case 2 : temp = carpi[i][j]; break;
case 3 : temp = spiral[i][j]; break;
}
ekranKontrol[i][j] = temp;
}
}
seviye++;
}
void showScore(int rakam, int basamak){
if(rakam == 0){
pinMode(birlera + (basamak*8), OUTPUT);
pinMode(birlerb + (basamak*8), OUTPUT);
pinMode(birlerc + (basamak*8), OUTPUT);
pinMode(birlerd + (basamak*8), OUTPUT);
pinMode(birlere + (basamak*8), OUTPUT);
pinMode(birlerf + (basamak*8), OUTPUT);
pinMode(birlerg + (basamak*8), INPUT);
}
if(rakam == 1){
pinMode(birlera + (basamak*8), INPUT);
pinMode(birlerb + (basamak*8), OUTPUT);
pinMode(birlerc + (basamak*8), OUTPUT);
pinMode(birlerd + (basamak*8), INPUT);
pinMode(birlere + (basamak*8), INPUT);
pinMode(birlerf + (basamak*8), INPUT);
pinMode(birlerg + (basamak*8), INPUT);
}
if(rakam == 2){
pinMode(birlera + (basamak*8), OUTPUT);
pinMode(birlerb + (basamak*8), OUTPUT);
pinMode(birlerc + (basamak*8), INPUT);
pinMode(birlerd + (basamak*8), OUTPUT);
pinMode(birlere + (basamak*8), OUTPUT);
pinMode(birlerf + (basamak*8), INPUT);
pinMode(birlerg + (basamak*8), OUTPUT);
}
if(rakam == 3){
pinMode(birlera + (basamak*8), OUTPUT);
pinMode(birlerb + (basamak*8), OUTPUT);
pinMode(birlerc + (basamak*8), OUTPUT);
pinMode(birlerd + (basamak*8), OUTPUT);
pinMode(birlere + (basamak*8), INPUT);
pinMode(birlerf + (basamak*8), INPUT);
pinMode(birlerg + (basamak*8), OUTPUT);
}
if(rakam == 4){
pinMode(birlera + (basamak*8), INPUT);
pinMode(birlerb + (basamak*8), OUTPUT);
pinMode(birlerc + (basamak*8), OUTPUT);
pinMode(birlerd + (basamak*8), INPUT);
pinMode(birlere + (basamak*8), INPUT);
pinMode(birlerf + (basamak*8), OUTPUT);
pinMode(birlerg + (basamak*8), OUTPUT);
}
if(rakam == 5){
pinMode(birlera + (basamak*8), OUTPUT);
pinMode(birlerb + (basamak*8), INPUT);
pinMode(birlerc + (basamak*8), OUTPUT);
pinMode(birlerd + (basamak*8), OUTPUT);
pinMode(birlere + (basamak*8), INPUT);
pinMode(birlerf + (basamak*8), OUTPUT);
pinMode(birlerg + (basamak*8), OUTPUT);
}
if(rakam == 6){
pinMode(birlera + (basamak*8), OUTPUT);
pinMode(birlerb + (basamak*8), INPUT);
pinMode(birlerc + (basamak*8), OUTPUT);
pinMode(birlerd + (basamak*8), OUTPUT);
pinMode(birlere + (basamak*8), OUTPUT);
pinMode(birlerf + (basamak*8), OUTPUT);
pinMode(birlerg + (basamak*8), OUTPUT);
}
if(rakam == 7){
pinMode(birlera + (basamak*8), OUTPUT);
pinMode(birlerb + (basamak*8), OUTPUT);
pinMode(birlerc + (basamak*8), OUTPUT);
pinMode(birlerd + (basamak*8), INPUT);
pinMode(birlere + (basamak*8), INPUT);
pinMode(birlerf + (basamak*8), INPUT);
pinMode(birlerg + (basamak*8), INPUT);
}
if(rakam == 8){
pinMode(birlera + (basamak*8), OUTPUT);
pinMode(birlerb + (basamak*8), OUTPUT);
pinMode(birlerc + (basamak*8), OUTPUT);
pinMode(birlerd + (basamak*8), OUTPUT);
pinMode(birlere + (basamak*8), OUTPUT);
pinMode(birlerf + (basamak*8), OUTPUT);
pinMode(birlerg + (basamak*8), OUTPUT);
}
if(rakam == 9){
pinMode(birlera + (basamak*8), OUTPUT);
pinMode(birlerb + (basamak*8), OUTPUT);
pinMode(birlerc + (basamak*8), OUTPUT);
pinMode(birlerd + (basamak*8), OUTPUT);
pinMode(birlere + (basamak*8), INPUT);
pinMode(birlerf + (basamak*8), OUTPUT);
pinMode(birlerg + (basamak*8), OUTPUT);
}
}