#include <U8g2lib.h>
#include <Wire.h> // library requires for IIC communication
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // initialization for the used OLED display
/* images */
static const unsigned char selector[] U8X8_PROGMEM = {0x02,0x05,0x06,0x08};
const unsigned char duck_gomona [] PROGMEM = {
0x01, 0x3f, 0x00, 0x00, 0x7b, 0xc2, 0x00, 0xc0, 0xa0, 0x88, 0x03, 0x0c, 0xc0, 0x80, 0x70, 0x47,
0x86, 0x3f, 0x9c, 0x81, 0x8f, 0x01, 0x00, 0xfc, 0x80, 0x07, 0x0b, 0x0c, 0xf3, 0x68, 0x70, 0x00,
0xc0, 0x03, 0xdc, 0x07, 0x08, 0x40, 0x08, 0xfc, 0x01, 0x01, 0x49, 0x08, 0x7c, 0x20, 0x7c, 0x00,
0xe5, 0x01, 0xf8, 0x3f, 0xf8, 0x41, 0x06, 0x00, 0x00, 0x40, 0x4a, 0x02, 0x60, 0xa1, 0x7d, 0x00,
0xa0, 0x44, 0xfe, 0x27, 0xfc, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x40, 0x06, 0x03, 0x40, 0x18, 0x00,
0xe0, 0x1c, 0xfe, 0x02, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x50, 0x4f, 0x01, 0x75, 0xd8, 0x00,
0x0f, 0x18, 0x4e, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xa1, 0x00, 0x00, 0x0f, 0x01, 0xe5, 0xed, 0x30,
0x2f, 0x00, 0x06, 0x06, 0xf8, 0xff, 0xff, 0xff, 0xe1, 0x01, 0x0c, 0x01, 0x00, 0xc7, 0x6d, 0x30,
0x0f, 0x00, 0x00, 0x74, 0xfc, 0xff, 0xff, 0xff, 0xe3, 0x01, 0x00, 0x00, 0x00, 0x83, 0x04, 0x00,
0x2f, 0x01, 0x03, 0x64, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x30, 0x00, 0x3c, 0x40, 0x00, 0x00,
0x0f, 0x10, 0x00, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xf8, 0x08, 0x7c, 0x40, 0x70, 0x00,
0x4f, 0x00, 0x00, 0x80, 0xff, 0x9f, 0xff, 0xff, 0x1f, 0x00, 0xfc, 0x0c, 0x40, 0x02, 0x18, 0x06,
0x08, 0x00, 0x00, 0xc0, 0xff, 0x03, 0xc0, 0xff, 0x1f, 0x00, 0xfc, 0x0f, 0x80, 0x00, 0x0c, 0x04,
0x64, 0x00, 0x00, 0xe0, 0xff, 0x02, 0xee, 0xff, 0x1f, 0x00, 0xe8, 0xff, 0x00, 0x00, 0x04, 0xc0,
0xc1, 0x01, 0x00, 0xe0, 0xff, 0x03, 0xfe, 0xff, 0x3f, 0x00, 0x80, 0xf3, 0x00, 0x00, 0xce, 0xe0,
0x40, 0x02, 0x00, 0xe0, 0xff, 0x9f, 0xff, 0xff, 0x3f, 0x04, 0x00, 0x60, 0x00, 0x00, 0xef, 0xe1,
0x02, 0x02, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x30, 0x00, 0x80, 0x3b, 0x00,
0x00, 0x00, 0x00, 0xfa, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x1f, 0x00,
0x05, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x0e, 0x00, 0x00, 0x0f, 0x00,
0x05, 0x80, 0x03, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x0f, 0x00, 0x06, 0x00, 0x00,
0x01, 0x98, 0x03, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x03, 0x07, 0x00, 0xc0, 0x01, 0x00,
0x00, 0x08, 0x01, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0xc3, 0x00, 0x00, 0x04, 0x02, 0x00,
0x00, 0x00, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f,
0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x78, 0x00, 0x04, 0x00, 0x3f,
0x00, 0x00, 0xf9, 0x3f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x70, 0x00, 0x02, 0x00, 0x60,
0x00, 0x00, 0xf0, 0x9c, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00,
0x00, 0x00, 0x78, 0x1c, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0xfc, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x03, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x40,
0x00, 0x00, 0xff, 0x3f, 0x01, 0xe0, 0x01, 0xf8, 0xff, 0x01, 0x1e, 0x00, 0x10, 0x00, 0x00, 0xc0,
0x00, 0xa0, 0xff, 0x7f, 0x01, 0xc0, 0x00, 0xc0, 0xff, 0x01, 0x38, 0x00, 0x7c, 0x00, 0x00, 0xc0,
0x40, 0xf6, 0xff, 0xcf, 0x00, 0x40, 0x00, 0x00, 0xf9, 0x03, 0x00, 0x6e, 0x78, 0x00, 0x00, 0xc0,
0xc0, 0xf2, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x20, 0xf0, 0x03, 0x00, 0x5f, 0x00, 0x00, 0xe0, 0xc3,
0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x1f, 0x00, 0x06, 0xf0, 0xf3,
0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x01, 0x1b, 0x00, 0x00, 0xf0, 0xff,
0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf1, 0x3f,
0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x41, 0x00, 0x00, 0x20, 0xec, 0x7f,
0xc0, 0xff, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0xfc, 0x21, 0x70, 0x07, 0x08, 0xd8, 0xff, 0x7f,
0xe0, 0xff, 0x07, 0x00, 0x04, 0x10, 0x00, 0x00, 0xf8, 0x03, 0xfe, 0x3f, 0x3f, 0xeb, 0xff, 0xff,
0xf0, 0xff, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0xf8, 0xc5, 0xff, 0x9f, 0x7f, 0xff, 0xff, 0xff,
0xf0, 0x3f, 0xbe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff,
0xf4, 0x23, 0xff, 0x1f, 0x00, 0x30, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff, 0xff,
0x2c, 0x30, 0xff, 0x3f, 0x00, 0x18, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff, 0xff,
0x04, 0xfc, 0xff, 0x7f, 0x00, 0x1c, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff,
0x80, 0xf8, 0xff, 0x7f, 0x02, 0x1e, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff,
0x43, 0xf8, 0xff, 0xff, 0x06, 0x5f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff,
0x00, 0xff, 0xff, 0xff, 0x07, 0x3f, 0x00, 0xd8, 0xfd, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff,
0x20, 0xfc, 0xff, 0xff, 0x83, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff,
0x6a, 0xfe, 0xff, 0xff, 0x87, 0x7f, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff,
0x2e, 0xfe, 0xff, 0xff, 0xc7, 0x7f, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff,
0x02, 0xfe, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff,
0x80, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xfc, 0xff,
0xe0, 0xff, 0xff, 0xf7, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x7f, 0xf8, 0xff,
0xf0, 0xff, 0xff, 0x03, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x3f, 0xf0, 0xff,
0xfa, 0xff, 0xbf, 0x05, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x1f, 0xf0, 0xff,
0xf0, 0xff, 0x3f, 0x08, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0xf3, 0xff, 0xff, 0x17, 0x3c, 0xf0, 0xff,
0xa1, 0xf0, 0x77, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0xf2, 0xff, 0xff, 0x07, 0x3c, 0xf0, 0xff,
0x04, 0xfc, 0x6f, 0x20, 0xfe, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x07, 0x7f, 0xf0, 0xff,
0x76, 0xf8, 0x07, 0x00, 0xff, 0xff, 0xff, 0xff, 0x87, 0xfc, 0xff, 0xff, 0x87, 0xff, 0xf8, 0xff,
0xff, 0xcd, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0x83, 0xe1, 0xfc, 0xff,
0xdf, 0xbf, 0x11, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0x07, 0x87, 0xff, 0xff,
0x86, 0x3f, 0x4b, 0x82, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0x0a, 0x86, 0xff, 0xff,
0x00, 0x6c, 0x31, 0x8a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0x7f, 0x18, 0xcf, 0xfd, 0xff,
0x00, 0x80, 0x18, 0x8a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0x3f, 0x00, 0x2f, 0xfc, 0xff,
0x00, 0x00, 0x0c, 0x8c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0x3f, 0x00, 0x04, 0xf8, 0xff
};
// pin constants
const int buttonLeft = 2;
const int buttonBack = 3;
const int buttonOk = 4;
const int buttonRight = 5;
// variables default to 0 (false), you don't need to tell the compiler that you want them to LOW or FALSE by default
boolean buttonOkPressed;
boolean buttonRightPressed;
boolean buttonLeftPressed;
boolean buttonBackPressed;
boolean prevButtonStateOk;
boolean prevButtonStateRight;
boolean prevButtonStateLeft;
boolean prevButtonStateBack;
int menu;
int settingValue = 3;
int mainee = 1;
void setup(void) {
u8g2.begin();
pinMode(buttonOk, INPUT_PULLUP);
pinMode(buttonRight, INPUT_PULLUP);
pinMode(buttonLeft, INPUT_PULLUP);
pinMode(buttonBack, INPUT_PULLUP);
load();
}
void loop(void) {
updateDisplay();
if (digitalRead(buttonOk) == 0) { // is the button pressed ?
if (prevButtonStateOk == 1) { // was it pressed on the previous cycle ?
buttonOkPressed = true; // if it wasn't pressed on the previous cycle, but now is, we need to registrer a press
prevButtonStateOk = 0; // inform the next cycle of the loop what the button state was on this one
} else buttonOkPressed = false; // if the previous cycle of the loop registered a press, we don't need to do it on this one as well
} else if (prevButtonStateOk == 0) {
prevButtonStateOk = 1; // the the physical button is released, we set up again for the next press
buttonOkPressed = false;
}
if (digitalRead(buttonRight) == 0) {
if (prevButtonStateRight == 1) {
buttonRightPressed = true;
prevButtonStateRight = 0;
} else buttonRightPressed = false;
} else if (prevButtonStateRight == 0) {
prevButtonStateRight = 1;
buttonRightPressed = false;
}
if (digitalRead(buttonLeft) == 0) {
if (prevButtonStateLeft == 1) {
buttonLeftPressed = true;
prevButtonStateLeft = 0;
} else buttonLeftPressed = false;
} else if (prevButtonStateLeft == 0) {
prevButtonStateLeft = 1;
buttonLeftPressed = false;
}
if (digitalRead(buttonBack) == 0) {
if (prevButtonStateBack == 1) {
buttonBackPressed = true;
prevButtonStateBack = 0;
} else buttonBackPressed = false;
} else if (prevButtonStateBack == 0) {
prevButtonStateBack = 1;
buttonBackPressed = false;
}
readButtons();
}
void readButtons() {
// was a button pressed ? (only update the display if a change is actually needed)
if (buttonBackPressed || buttonOkPressed || buttonRightPressed || buttonLeftPressed) {
// menu is the main variable for the . . . well, menus !
// 0 displays the Home page, anything else from 1 to 100 displays
// the menu selector, and the rest are the sub menus
// ====== ADD THE CHECKS FOR EACH BUTTON PRESS HERE ======
// first, we manage changes that need to be done to the interface (in case a button is pressed)
if (buttonOkPressed && menu == 0) menu = 100;
else if (buttonBackPressed && menu >= 100 && menu <= 199) menu = 0;
else if (buttonRightPressed && menu == 100) menu = 101; // files to trash
else if (buttonLeftPressed && menu == 101) menu = 100; // trash to files
else if (buttonRightPressed && menu == 101) menu = 102; // trash to connect
else if (buttonLeftPressed && menu == 102) menu = 101; // connect to trash
else if (buttonRightPressed && menu == 102) menu = 103; // connect to message
else if (buttonLeftPressed && menu == 103) menu = 102; // message to connect
else if (buttonRightPressed && menu == 103) menu = 104; // message to call
else if (buttonLeftPressed && menu == 104) menu = 103; // call to message
else if (buttonRightPressed && menu == 104) menu = 105; //call to camera
else if (buttonLeftPressed && menu == 105) menu = 104; // camera to call
else if (buttonRightPressed && menu == 105) menu = 106; // camera to play
else if (buttonLeftPressed && menu == 106) menu = 105; // play to camera
else if (buttonRightPressed && menu == 106) menu = 107; // play to more
else if (buttonLeftPressed && menu == 107) menu = 106; // more to play
else if (buttonRightPressed && menu == 107) menu = 108; // more to settings
else if (buttonLeftPressed && menu == 108) menu = 107; // settings to more
else if (buttonRightPressed && menu == 108) menu = 100; // settings to files
else if (buttonLeftPressed && menu == 100) menu = 108; // files to settings
//entering ☺
else if (buttonOkPressed && menu == 100) menu = 200; // files to inside files
else if (buttonBackPressed && menu == 200) menu = 100; // inside files to files
else if (buttonOkPressed && menu == 101) menu = 201; // enter trash
else if (buttonBackPressed && menu == 201) menu = 101; // exit trash
else if (buttonOkPressed && menu == 102) menu = 202; // enter connect
else if (buttonBackPressed && menu == 202) menu = 102; // exit connect (username)
else if (buttonOkPressed && menu == 103) menu = 203; // enter message
else if (buttonBackPressed && menu == 203) menu = 103; // exit message (example)
else if (buttonOkPressed && menu == 104) menu = 204;
else if (buttonBackPressed && menu == 204) menu = 104;
else if (buttonOkPressed && menu == 105) menu = 205;
else if (buttonBackPressed && menu == 205) menu = 105;
else if (buttonOkPressed && menu == 106) menu = 206;
else if (buttonBackPressed && menu == 206) menu = 106;
else if (buttonOkPressed && menu == 107) menu = 207;
else if (buttonBackPressed && menu == 207) menu = 107;
else if (buttonOkPressed && menu == 108) menu = 208;
else if (buttonBackPressed && menu == 208) menu = 108;
else if (buttonOkPressed && menu == 200) menu = 300;
else if (buttonBackPressed && menu == -300) menu = 200;
else if (buttonOkPressed && menu == -300) menu = 400;
else if (buttonBackPressed && menu == 400) menu = -300;
else if (buttonOkPressed && menu == 400) menu = 500;
else if (buttonBackPressed && menu == 500) menu = 400;
else if (buttonOkPressed && menu == 500) menu = 600;
else if (buttonBackPressed && menu == 600) menu = 500;
else if (buttonRightPressed && menu == 208 && settingValue >= 3 && settingValue <= 47) settingValue += 11;
else if (buttonLeftPressed && menu == 208 && settingValue <= 58 && settingValue >= 14) settingValue -= 11;
updateDisplay(); // second, we send the data to the actual display
}
}
void updateDisplay() {
if (menu == 0) { //here, we update the actual display, depending on the menu variable
displayHome(mainee);
mainee += 1;
} else {
// ====== ADD YOUR MENUS HERE ======
if (menu == 100) displayFiles();
else if (menu == 101) displayTrash();
else if (menu == 102) displayConnect();
else if (menu == 103) displayMessage();
else if (menu == 104) displayCall();
else if (menu == 105) displayCamera();
else if (menu == 106) displayPlay();
else if (menu == 107) displayMore();
else if (menu == 108) displaySettings();
// entering simple
else if (menu == 200) displayFilesInside();
else if (menu == 201) displayTrashInside();
else if (menu == 202) displayConnectInside();
else if (menu == 203) displayMessageInside();
else if (menu == 204) displayCallInside();
else if (menu == 205) displayCameraInside();
else if (menu == 206) displayPlayInside();
else if (menu == 207) displayMoreInside();
else if (menu == 208) displaySettingsInside(settingValue);
// inside files
else if (menu == 300) OpenMdFile();
else if (menu == -300) open();
else if (menu == 400) ReadMePageTwo();
else if (menu == 500) ReadMePageThree();
else if (menu == 600) ReadMePageFour();
// inside settings
/* else if (menu == 308) displaySettingsInsideB();
else if (menu == 408) displaySettingsInsideC();
else if (menu == 508) displaySettingsInsideD();
else if (menu == 608) displaySettingsInsideE();
else if (menu == 708) displaySettingsInsideF();*/
}
}
// ====== ADD YOUR IMAGES AND PAGES HERE ======
void displayHome(int cas) { // menu 0
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(37, 35, "12:34");
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(81, 43, "Mon");
u8g2.setFont(u8g2_font_helvB08_tr);
u8g2.drawStr(3, 62, "10");
u8g2.setFont(u8g2_font_helvB08_tr);
u8g2.drawStr(16, 62, "/");
u8g2.setFont(u8g2_font_helvB08_tr);
u8g2.drawStr(22, 62, "08");
if (cas > 1 && cas <= 10) {
u8g2.drawCircle(44, 25, 19);
u8g2.drawCircle(112, 64, 16);
u8g2.drawDisc(51, 61, 5);
u8g2.drawCircle(100, 13, 2);
u8g2.drawDisc(7, 30, 3);
u8g2.drawLine(0, 33, 5, 31);
u8g2.drawLine(43, 44, 48, 57);
u8g2.drawLine(9, 32, 46, 59);
u8g2.drawLine(9, 29, 25, 21);
u8g2.drawLine(61, 16, 98, 12);
u8g2.drawLine(101, 15, 108, 48);
u8g2.drawLine(99, 14, 55, 57);
u8g2.drawLine(60, 37, 98, 58);
u8g2.drawLine(56, 61, 97, 62);
} else if (cas > 10 && cas <= 20) {
u8g2.drawCircle(43, 22, 19);
u8g2.drawCircle(115, 65, 16);
u8g2.drawDisc(51, 63, 5);
u8g2.drawCircle(98, 15, 2);
u8g2.drawDisc(7, 33, 3);
u8g2.drawLine(0, 33, 5, 34);
u8g2.drawLine(42, 42, 48, 59);
u8g2.drawLine(9, 34, 46, 60);
u8g2.drawLine(9, 31, 24, 21);
u8g2.drawLine(61, 16, 96, 14);
u8g2.drawLine(99, 17, 112, 50);
u8g2.drawLine(96, 17, 54, 58);
u8g2.drawLine(59, 34, 100, 58);
u8g2.drawLine(56, 61, 99, 62);
} else if (cas > 20 && cas <= 30) {
u8g2.drawCircle(48, 20, 19);
u8g2.drawCircle(115, 62, 16);
u8g2.drawDisc(48, 63, 5);
u8g2.drawCircle(98, 18, 2);
u8g2.drawDisc(7, 33, 3);
u8g2.drawLine(0, 33, 5, 34);
u8g2.drawLine(46, 40, 49, 58);
u8g2.drawLine(9, 34, 43, 60);
u8g2.drawLine(9, 31, 28, 18);
u8g2.drawLine(68, 16, 96, 18);
u8g2.drawLine(100, 20, 111, 46);
u8g2.drawLine(97, 20, 52, 59);
u8g2.drawLine(64, 31, 101, 54);
u8g2.drawLine(53, 61, 99, 59);
} else if (cas > 30 && cas <= 40) {
u8g2.drawCircle(49, 24, 19);
u8g2.drawCircle(118, 61, 16);
u8g2.drawDisc(49, 65, 5);
u8g2.drawCircle(97, 16, 2);
u8g2.drawDisc(7, 31, 3);
u8g2.drawLine(0, 33, 4, 32);
u8g2.drawLine(47, 43, 48, 59);
u8g2.drawLine(10, 33, 46, 62);
u8g2.drawLine(9, 31, 30, 21);
u8g2.drawLine(68, 16, 94, 15);
u8g2.drawLine(100, 17, 111, 46);
u8g2.drawLine(97, 18, 52, 59);
u8g2.drawLine(67, 30, 104, 53);
u8g2.drawLine(53, 61, 102, 57);
} else if (cas > 40) {
u8g2.drawCircle(44, 25, 19);
u8g2.drawCircle(112, 64, 16);
u8g2.drawDisc(51, 61, 5);
u8g2.drawCircle(100, 13, 2);
u8g2.drawDisc(7, 30, 3);
u8g2.drawLine(0, 33, 5, 31);
u8g2.drawLine(43, 44, 48, 57);
u8g2.drawLine(9, 32, 46, 59);
u8g2.drawLine(9, 29, 25, 21);
u8g2.drawLine(61, 16, 98, 12);
u8g2.drawLine(101, 15, 108, 48);
u8g2.drawLine(99, 14, 55, 57);
u8g2.drawLine(60, 37, 98, 58);
u8g2.drawLine(56, 61, 97, 62);
mainee = 1;
}
u8g2.sendBuffer();
}
void displayFiles() { // menu 100
u8g2.clearBuffer();
u8g2.drawLine(47, 16, 47, 12);
u8g2.drawLine(46, 12, 83, 12);
u8g2.drawLine(84, 12, 80, 41);
u8g2.drawLine(76, 16, 80, 41);
u8g2.drawLine(76, 16, 42, 16);
u8g2.drawLine(42, 16, 46, 41);
u8g2.drawLine(46, 41, 80, 41);
u8g2.drawDisc(72, 11, 2);
u8g2.drawCircle(55, 8, 5);
u8g2.drawDisc(66, 15, 1);
u8g2.drawCircle(46, 9, 1);
u8g2.drawDisc(82, 17, 3);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(48, 58, "Files");
u8g2.sendBuffer();
}
void displayTrash() { // menu 101
u8g2.clearBuffer();
u8g2.drawLine(46, 6, 53, 39);
u8g2.drawLine(46, 5, 57, 9);
u8g2.drawLine(57, 9, 72, 9);
u8g2.drawLine(69, 9, 81, 6);
u8g2.drawLine(47, 4, 60, 2);
u8g2.drawLine(58, 2, 70, 2);
u8g2.drawLine(70, 2, 81, 5);
u8g2.drawLine(81, 6, 76, 39);
u8g2.drawLine(54, 39, 61, 41);
u8g2.drawLine(61, 41, 67, 41);
u8g2.drawLine(67, 41, 75, 39);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(48, 58, "Trash");
u8g2.drawLine(57, 5, 60, 9);
u8g2.drawLine(63, 7, 68, 9);
u8g2.drawLine(53, 6, 60, 8);
u8g2.drawLine(64, 2, 61, 8);
u8g2.drawLine(76, 0, 70, 8);
u8g2.drawLine(49, 0, 56, 7);
u8g2.drawLine(76, 1, 74, 8);
u8g2.drawLine(67, 1, 70, 8);
u8g2.drawPixel(66, 9);
u8g2.drawLine(71, 2, 65, 8);
u8g2.drawLine(59, 13, 53, 31);
u8g2.drawLine(57, 5, 64, 3);
u8g2.drawLine(51, 15, 58, 33);
u8g2.drawLine(65, 0, 68, 8);
u8g2.drawLine(79, 13, 73, 31);
u8g2.drawLine(61, 6, 66, 2);
u8g2.drawLine(75, 13, 78, 30);
u8g2.drawLine(68, 5, 75, 5);
u8g2.drawLine(77, 6, 80, 3);
u8g2.sendBuffer();
}
void displayConnect() { // menu 102
u8g2.clearBuffer();
u8g2.drawCircle(63.5, 19.5, 19.5);
u8g2.drawLine(67, 1, 70, 18);
u8g2.drawLine(71, 17, 67, 39);
u8g2.drawLine(71, 2, 77, 18);
u8g2.drawLine(77, 17, 73, 36);
u8g2.drawLine(62, 1, 58, 16);
u8g2.drawLine(58, 16, 62, 38);
u8g2.drawLine(57, 2, 51, 18);
u8g2.drawLine(51, 18, 57, 38);
u8g2.drawLine(52, 5, 63, 10);
u8g2.drawLine(64, 10, 77, 6);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(44, 58, "Connect");
u8g2.drawLine(47, 11, 63, 17);
u8g2.drawLine(45, 19, 61, 23);
u8g2.drawLine(45, 27, 62, 28);
u8g2.drawLine(53, 36, 62, 34);
u8g2.drawLine(63, 34, 72, 36);
u8g2.drawLine(63, 17, 81, 11);
u8g2.drawLine(61, 23, 82, 19);
u8g2.drawLine(62, 28, 81, 26);
u8g2.sendBuffer();
}
void displayMessage() { // menu 103
u8g2.clearBuffer();
u8g2.drawFrame(35, 7, 57, 38);
u8g2.drawLine(35, 7, 62, 23);
u8g2.drawLine(91, 7, 63, 23);
u8g2.drawDisc(63, 24, 3);
u8g2.drawPixel(89, 42);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(43, 58, "Message");
u8g2.sendBuffer();
}
void displayCall() { // menu 104
u8g2.clearBuffer();
u8g2.drawDisc(56, 10, 7);
u8g2.drawDisc(51, 37, 7);
u8g2.drawCircle(62, 11, 7);
u8g2.drawCircle(57, 37, 6);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(52, 58, "Call");
u8g2.drawLine(69, 8, 70, 27);
u8g2.drawLine(70, 28, 63, 42);
u8g2.drawLine(59, 18, 60, 22);
u8g2.drawLine(60, 22, 56, 31);
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(77, 26, ")");
u8g2.setFont(u8g2_font_haxrcorp4089_tr);
u8g2.drawStr(82, 27, ")");
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(85, 31, ")");
u8g2.drawPixel(74, 23);
u8g2.drawLine(48, 7, 39, 3);
u8g2.drawLine(48, 12, 42, 13);
u8g2.drawLine(49, 18, 47, 18);
u8g2.drawLine(43, 32, 40, 27);
u8g2.drawLine(41, 38, 32, 38);
u8g2.drawLine(45, 44, 40, 46);
u8g2.sendBuffer();
}
void displayCamera() { // menu 105
u8g2.clearBuffer();
u8g2.drawCircle(59, 22, 11);
u8g2.drawDisc(59, 22, 5);
u8g2.drawBox(71, 15, 16, 25);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(46, 58, "Camera");
u8g2.drawCircle(59, 22, 8);
u8g2.drawBox(40, 34, 31, 6);
u8g2.drawBox(40, 15, 8, 19);
u8g2.drawBox(48, 29, 3, 5);
u8g2.drawPixel(70, 28);
u8g2.drawBox(68, 29, 3, 5);
u8g2.drawPixel(48, 28);
u8g2.drawBox(65, 32, 3, 2);
u8g2.drawLine(48, 15, 50, 15);
u8g2.drawBox(51, 32, 3, 2);
u8g2.drawLine(48, 16, 48, 19);
u8g2.drawLine(68, 15, 70, 15);
u8g2.drawLine(70, 16, 70, 18);
u8g2.drawFrame(77, 12, 7, 5);
u8g2.drawPixel(63, 11);
u8g2.drawPixel(69, 16);
u8g2.sendBuffer();
}
void displayPlay() { // menu 106
u8g2.clearBuffer();
u8g2.drawLine(41, 11, 84, 11);
u8g2.drawLine(49, 31, 77, 31);
u8g2.drawLine(41, 11, 33, 20);
u8g2.drawLine(33, 20, 34, 36);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(34, 58, "spend time");
u8g2.drawLine(35, 36, 39, 40);
u8g2.drawLine(40, 40, 47, 39);
u8g2.drawLine(47, 39, 49, 31);
u8g2.drawLine(79, 39, 77, 31);
u8g2.drawLine(79, 39, 86, 40);
u8g2.drawLine(90, 36, 86, 40);
u8g2.drawLine(92, 20, 91, 36);
u8g2.drawLine(84, 11, 92, 20);
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(46, 28, "+");
u8g2.drawCircle(74, 21, 5);
u8g2.sendBuffer();
}
void displayMore() { // menu 107
u8g2.clearBuffer();
u8g2.drawFrame(39, 4, 21, 20);
u8g2.drawFrame(64, 4, 21, 20);
u8g2.drawFrame(39, 28, 21, 20);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(52, 58, "More");
u8g2.drawCircle(74, 37, 9);
u8g2.setFont(u8g2_font_helvB08_tr);
u8g2.drawStr(72, 41, "+");
u8g2.sendBuffer();
}
void displaySettings() { // menu 108
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(42, 56, "Settings");
u8g2.drawDisc(64, 23, 5);
u8g2.drawCircle(64, 23, 13);
u8g2.drawLine(64, 10, 65, 6);
u8g2.drawLine(66, 5, 73, 7);
u8g2.drawLine(73, 7, 72, 11);
u8g2.drawLine(75, 16, 79, 14);
u8g2.drawLine(80, 14, 82, 20);
u8g2.drawLine(82, 20, 78, 23);
u8g2.drawLine(58, 10, 55, 7);
u8g2.drawLine(55, 7, 51, 11);
u8g2.drawLine(51, 11, 53, 15);
u8g2.drawLine(52, 20, 48, 19);
u8g2.drawLine(47, 19, 47, 28);
u8g2.drawLine(47, 28, 51, 26);
u8g2.drawLine(54, 32, 51, 35);
u8g2.drawLine(51, 35, 57, 40);
u8g2.drawLine(57, 40, 59, 36);
u8g2.drawLine(77, 27, 81, 30);
u8g2.drawLine(81, 30, 77, 36);
u8g2.drawLine(73, 33, 77, 36);
u8g2.drawLine(71, 35, 73, 40);
u8g2.drawLine(65, 36, 65, 40);
u8g2.drawLine(65, 40, 72, 40);
u8g2.sendBuffer();
}
//entering simple
void displayFilesInside() { // menu 200
u8g2.clearBuffer();
u8g2.drawLine(0, 10, 127, 10);
u8g2.drawLine(6, 1, 9, 1);
u8g2.drawLine(9, 2, 9, 8);
u8g2.drawLine(8, 8, 3, 8);
u8g2.drawLine(3, 4, 3, 7);
u8g2.drawLine(3, 4, 6, 1);
u8g2.drawLine(4, 4, 6, 4);
u8g2.drawLine(6, 2, 6, 4);
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(13, 8, "Read me.md");
u8g2.drawFrame(118, 1, 8, 8);
u8g2.drawBox(120, 3, 4, 4);
u8g2.sendBuffer();
}
void displayTrashInside() { // menu 201
u8g2.clearBuffer();
u8g2.drawLine(78, 15, 78, 55);
u8g2.drawLine(45, 15, 45, 55);
u8g2.drawLine(45, 55, 78, 55);
u8g2.drawFrame(48, 18, 28, 35);
u8g2.drawLine(45, 15, 58, 15);
u8g2.drawLine(65, 15, 77, 15);
u8g2.drawLine(54, 27, 57, 28);
u8g2.drawLine(57, 28, 60, 27);
u8g2.drawLine(67, 28, 70, 27);
u8g2.drawLine(64, 27, 67, 28);
u8g2.drawLine(60, 41, 64, 41);
u8g2.drawDisc(62, 14, 2);
u8g2.drawBox(52, 15, 21, 3);
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(83, 29, "z");
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(88, 22, "Z");
u8g2.sendBuffer();
}
void displayConnectInside() { // menu 202
u8g2.clearBuffer();
u8g2.drawCircle(17, 29, 13);
u8g2.drawDisc(17, 25, 4);
u8g2.drawBox(8, 36, 19, 3);
u8g2.drawBox(10, 39, 15, 2);
u8g2.drawLine(14, 41, 21, 41);
u8g2.drawLine(7, 36, 16, 33);
u8g2.drawLine(18, 33, 27, 36);
u8g2.drawPixel(17, 33);
u8g2.drawBox(12, 34, 11, 2);
u8g2.drawFrame(34, 30, 92, 12);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(34, 27, "Username (SSD)");
u8g2.drawLine(36, 32, 36, 39); // input |
u8g2.drawLine(57, 58, 63, 62);
u8g2.drawLine(64, 62, 70, 58);
u8g2.sendBuffer();
/* password */
/*
u8g2.drawFrame(34, 30, 92, 12);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(34, 27, "Password");
u8g2.drawCircle(17, 29, 13);
u8g2.drawLine(36, 32, 36, 39);
u8g2.drawLine(57, 58, 63, 62);
u8g2.drawLine(64, 62, 70, 58);
u8g2.drawLine(112, 35, 117, 33);
u8g2.drawLine(123, 35, 118, 33);
u8g2.drawLine(123, 36, 118, 38);
u8g2.drawLine(112, 36, 117, 38);
u8g2.drawDisc(117, 36, 1);
u8g2.drawDisc(118, 35, 1);
u8g2.setFont(u8g2_font_haxrcorp4089_tr);
u8g2.drawStr(9, 35, "***");
*/
}
void displayMessageInside() { // menu 203
u8g2.clearBuffer();
u8g2.drawDisc(120, 6, 5);
u8g2.drawLine(111, 5, 106, 2);
u8g2.drawLine(111, 5, 106, 7);
u8g2.drawLine(106, 7, 106, 60);
u8g2.drawLine(106, 1, 3, 1);
u8g2.drawLine(2, 1, 2, 61);
u8g2.drawLine(2, 61, 106, 61);
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(4, 10, "first line max: 25;");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(4, 17, "second line");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(4, 31, "...");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(4, 24, "...");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(4, 52, "you have, but who you are.");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(4, 59, "LOL");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(4, 45, "Success is not in what");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(4, 38, "but nobody came");
u8g2.drawBox(116, 46, 5, 9);
u8g2.drawLine(116, 44, 114, 47);
u8g2.drawLine(120, 44, 122, 47);
u8g2.drawLine(115, 54, 116, 55);
u8g2.drawLine(120, 55, 121, 54);
u8g2.drawLine(113, 56, 116, 58);
u8g2.drawLine(123, 56, 120, 58);
u8g2.drawLine(112, 56, 113, 59);
u8g2.drawLine(124, 56, 123, 58);
u8g2.drawLine(114, 58, 122, 58);
u8g2.drawLine(114, 59, 122, 59);
u8g2.drawBox(116, 44, 5, 2);
u8g2.drawBox(114, 47, 2, 7);
u8g2.drawBox(121, 47, 2, 7);
u8g2.drawBox(117, 55, 3, 1);
u8g2.drawBox(117, 59, 3, 3);
u8g2.sendBuffer();
}
void displayCallInside() { // menu 204
u8g2.clearBuffer();
u8g2.drawFrame(2, 15, 21, 20);
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(8, 32, "1");
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(33, 32, "2");
u8g2.drawFrame(27, 15, 21, 20);
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(58, 32, "3");
u8g2.drawFrame(52, 39, 21, 20);
u8g2.drawFrame(52, 15, 21, 20);
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(58, 56, "8");
u8g2.drawFrame(27, 39, 21, 20);
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(33, 56, "7");
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(83, 56, "9");
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(8, 56, "6");
u8g2.drawFrame(77, 39, 21, 20);
u8g2.drawFrame(2, 39, 21, 20);
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(108, 56, "0");
u8g2.drawFrame(102, 15, 21, 20);
u8g2.drawFrame(102, 39, 21, 20);
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(108, 32, "5");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(105, 64, "*");
u8g2.drawFrame(77, 15, 21, 20);
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(118, 64, "#");
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(83, 32, "4");
u8g2.drawLine(111, 7, 115, 10);
u8g2.drawLine(115, 10, 120, 3);
u8g2.drawFrame(110, 1, 12, 12);
u8g2.setFont(u8g2_font_haxrcorp4089_tr);
u8g2.drawStr(5, 11, "0123456789*#");
u8g2.sendBuffer();
}
void displayCameraInside() { // menu 205
u8g2.clearBuffer();
u8g2.drawXBMP(0, 0, 128, 64, duck_gomona);
u8g2.sendBuffer();
}
void displayPlayInside() { // menu 206
u8g2.clearBuffer();
u8g2.sendBuffer();
}
void displayMoreInside() { // menu 207
u8g2.clearBuffer();
u8g2.sendBuffer();
}
void displaySettingsInside(int value) { // menu 208
u8g2.clearBuffer();
u8g2.drawLine(0, 10, 127, 10);
u8g2.drawLine(0, 21, 127, 21);
u8g2.drawLine(0, 32, 127, 32);
u8g2.drawLine(0, 43, 127, 43);
u8g2.drawLine(0, 54, 127, 54);
u8g2.drawFrame(118, 1, 8, 8);
u8g2.drawFrame(118, 12, 8, 8);
u8g2.drawFrame(118, 23, 8, 8);
u8g2.drawFrame(118, 34, 8, 8);
u8g2.drawFrame(118, 45, 8, 8);
u8g2.drawFrame(118, 56, 8, 8);
u8g2.drawBox(120, value, 4, 4);
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(10, 9, "Theme");
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(10, 20, "Time and Date");
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(11, 31, "On/Off");
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(11, 42, "Memory");
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(11, 53, "Security");
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(11, 64, "Reset");
u8g2.drawLine(5, 36, 5, 38);
u8g2.drawLine(6, 38, 8, 39);
u8g2.drawLine(3, 35, 3, 38);
u8g2.drawLine(3, 38, 2, 39);
u8g2.drawLine(3, 40, 6, 40);
u8g2.drawLine(5, 35, 8, 39);
u8g2.drawLine(2, 35, 1, 39);
u8g2.drawLine(4, 41, 5, 41);
u8g2.drawFrame(3, 45, 3, 4);
u8g2.drawDisc(4, 50, 2);
u8g2.drawLine(1, 28, 2, 29);
u8g2.drawLine(3, 29, 6, 25);
u8g2.drawLine(2, 25, 7, 27);
u8g2.drawCircle(5, 16, 3);
u8g2.drawLine(5, 14, 5, 16);
u8g2.drawPixel(6, 16);
u8g2.drawCircle(5, 59, 3);
u8g2.drawLine(0, 59, 3, 61);
u8g2.drawLine(3, 60, 5, 58);
u8g2.drawPixel(3, 59);
u8g2.drawPixel(4, 5);
u8g2.drawPixel(5, 4);
u8g2.drawCircle(5, 5, 3);
u8g2.sendBuffer();
}
/* inside */
void OpenMdFile() {
u8g2.clearBuffer();
u8g2.drawLine(10, 44, 10, 50);
u8g2.drawLine(25, 8, 40, 8);
u8g2.drawLine(41, 45, 41, 50);
u8g2.drawLine(10, 51, 41, 51);
u8g2.drawLine(10, 22, 24, 8);
u8g2.drawLine(10, 22, 24, 22);
u8g2.drawLine(24, 9, 24, 21);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(48, 26, "Opening .md");
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawStr(48, 39, "File");
u8g2.drawFrame(5, 31, 42, 14);
u8g2.drawPixel(73, 38);
u8g2.drawLine(41, 8, 41, 31);
u8g2.drawLine(10, 23, 10, 31);
u8g2.setFont(u8g2_font_6x10_tr);
u8g2.drawBox(6, 32, 40, 3);
u8g2.drawBox(6, 42, 40, 2);
u8g2.drawBox(6, 35, 12, 7);
u8g2.drawBox(18, 34, 4, 7);
u8g2.drawBox(33, 35, 13, 7);
u8g2.drawFrame(22, 35, 10, 2);
u8g2.drawBox(29, 38, 2, 3);
u8g2.drawPixel(31, 37);
u8g2.drawPixel(31, 39);
u8g2.drawPixel(31, 41);
u8g2.drawLine(27, 37, 27, 41);
u8g2.drawPixel(26, 37);
u8g2.drawPixel(28, 37);
u8g2.drawPixel(28, 41);
u8g2.drawPixel(24, 37);
u8g2.drawPixel(20, 41);
u8g2.drawPixel(21, 41);
u8g2.drawLine(23, 38, 23, 41);
u8g2.drawLine(25, 38, 25, 41);
u8g2.drawPixel(24, 41);
u8g2.sendBuffer();
delay(4000);
menu = -300;
}
void open() {
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(1, 8, "Arduino OLED Menu Sketch");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 15, "This Arduino sketch demonstrates");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 21, "a simple menu system using an");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 27, "OLED display. The menu allows");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 33, "navigation through different");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 39, "options using buttons, and");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 45, "relevant information is");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 51, "displayed on the OLED screen.");
u8g2.drawLine(121, 60, 126, 60);
u8g2.drawLine(125, 61, 122, 61);
u8g2.drawLine(123, 62, 124, 62);
u8g2.sendBuffer();
}
void ReadMePageTwo() {
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(1, 8, "Customize");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 15, "Feel free to edit the sketch");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 21, "according to your specific");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 27, "requirements. You can modify the");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 33, "menu structure, add more options");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 39, "or integrate additional sensors");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 45, "and features.");
u8g2.drawLine(121, 60, 126, 60);
u8g2.drawLine(125, 61, 122, 61);
u8g2.drawLine(123, 62, 124, 62);
u8g2.drawLine(123, 1, 124, 1);
u8g2.drawLine(125, 2, 122, 2);
u8g2.drawLine(121, 3, 126, 3);
u8g2.sendBuffer();
}
void ReadMePageThree() {
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(1, 8, "License");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 15, "This project is licensed under");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 21, "the MIT License");
u8g2.drawLine(123, 1, 124, 1);
u8g2.drawLine(125, 2, 122, 2);
u8g2.drawLine(121, 3, 126, 3);
u8g2.sendBuffer();
}
void ReadMePageFour() {
u8g2.clearBuffer();
u8g2.drawLine(34, 30, 92, 50);
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(1, 60, "error");
u8g2.drawDisc(53, 19, 6);
u8g2.setFont(u8g2_font_helvB08_tr);
u8g2.drawStr(23, 60, "404");
u8g2.drawDisc(80, 27, 6);
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(7, 7, "the page you are looking for");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(87, 17, "Moved or");
u8g2.setFont(u8g2_font_4x6_tr);
u8g2.drawStr(91, 28, "Deleted");
u8g2.drawPixel(17, 20);
u8g2.drawPixel(106, 54);
u8g2.drawPixel(65, 59);
u8g2.drawFrame(13, 15, 8, 8);
u8g2.drawFrame(63, 57, 6, 6);
u8g2.drawFrame(103, 51, 5, 6);
u8g2.sendBuffer();
}
void load() {
for (int i = 0; i <= 3; i++) {
u8g2.clearBuffer();
u8g2.drawCircle(42, 30, 6);
u8g2.drawCircle(62, 30, 6);
u8g2.drawCircle(82, 30, 6);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(44, 28, 6);
u8g2.drawCircle(60, 32, 6);
u8g2.drawCircle(82, 30, 6);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(49, 25, 6);
u8g2.drawCircle(54, 38, 6);
u8g2.drawCircle(82, 30, 6);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(57, 27, 6);
u8g2.drawCircle(47, 39, 6);
u8g2.drawCircle(82, 30, 6);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(62, 30, 6);
u8g2.drawCircle(42, 30, 6);
u8g2.drawCircle(82, 30, 6);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(66, 35, 6);
u8g2.drawCircle(42, 30, 6);
u8g2.drawCircle(79, 25, 6);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(73, 37, 6);
u8g2.drawCircle(42, 30, 6);
u8g2.drawCircle(72, 23, 6);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(80, 32, 6);
u8g2.drawCircle(42, 30, 6);
u8g2.drawCircle(63, 25, 6);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(82, 30, 6);
u8g2.drawCircle(42, 30, 6);
u8g2.drawCircle(62, 30, 6);
u8g2.sendBuffer();
delay(60);
}
/* transition */
u8g2.clearBuffer();
u8g2.drawCircle(82, 30, 6);
u8g2.drawCircle(42, 30, 6);
u8g2.drawCircle(62, 30, 6);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(51, 33, 6);
u8g2.drawCircle(65, 33, 6);
u8g2.drawCircle(85, 39, 6);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(57, 29, 5);
u8g2.drawCircle(62, 27, 5);
u8g2.drawCircle(78, 39, 5);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(65, 24, 5);
u8g2.drawCircle(58, 23, 5);
u8g2.drawCircle(74, 43, 5);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(68, 19, 4);
u8g2.drawCircle(55, 20, 4);
u8g2.drawCircle(70, 45, 4);
u8g2.sendBuffer();
delay(60);
u8g2.clearBuffer();
u8g2.drawCircle(74, 15, 4);
u8g2.drawCircle(52, 15, 4);
u8g2.drawCircle(63, 48, 4);
u8g2.sendBuffer();
delay(120);
u8g2.drawBox(61, 39, 5, 6);
u8g2.sendBuffer();
delay(120);
u8g2.drawBox(61, 37, 5, 8);
u8g2.sendBuffer();
delay(120);
u8g2.drawBox(56, 33, 15, 4);
u8g2.sendBuffer();
delay(120);
u8g2.drawBox(56, 33, 15, 4);
u8g2.sendBuffer();
delay(120);
u8g2.drawBox(67, 30, 7, 3);
u8g2.drawBox(53, 30, 7, 3);
u8g2.sendBuffer();
delay(120);
u8g2.drawBox(52, 28, 7, 2);
u8g2.drawBox(68, 28, 7, 2);
u8g2.sendBuffer();
delay(120);
u8g2.drawBox(50, 26, 8, 2);
u8g2.drawBox(69, 26, 8, 2);
u8g2.sendBuffer();
delay(120);
u8g2.drawBox(50, 19, 5, 7);
u8g2.drawBox(72, 19, 5, 7);
u8g2.sendBuffer();
delay(120);
for (int i = 0; i <= 60; i++) {
u8g2.clearBuffer();
if (i <= 25) {
u8g2.drawCircle(52-i, 15, 4);
u8g2.drawCircle(74-i, 15, 4);
u8g2.drawCircle(63-i, 48, 4);
u8g2.drawBox(50-i, 19, 5, 7);
u8g2.drawBox(50-i, 26, 8, 2);
u8g2.drawBox(52-i, 28, 7, 2);
u8g2.drawBox(72-i, 19, 5, 7);
u8g2.drawBox(69-i, 26, 8, 2);
u8g2.drawBox(68-i, 28, 7, 2);
u8g2.drawBox(56-i, 33, 15, 4);
u8g2.drawBox(61-i, 37, 5, 8);
u8g2.drawBox(53-i, 30, 7, 3);
u8g2.drawBox(67-i, 30, 7, 3);
} else {
u8g2.drawCircle(27, 15, 4);
u8g2.drawCircle(49, 15, 4);
u8g2.drawCircle(38, 48, 4);
u8g2.drawBox(25, 19, 5, 7);
u8g2.drawBox(25, 26, 8, 2);
u8g2.drawBox(27, 28, 7, 2);
u8g2.drawBox(47, 19, 5, 7);
u8g2.drawBox(44, 26, 8, 2);
u8g2.drawBox(43, 28, 7, 2);
u8g2.drawBox(31, 33, 15, 4);
u8g2.drawBox(36, 37, 5, 8);
u8g2.drawBox(28, 30, 7, 3);
u8g2.drawBox(42, 30, 7, 3);
}
if (i >= 15 && i < 20) {
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(59, 31, "a");
}
if (i >= 20 && i < 25) {
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(59, 31, "ya");
}
if (i >= 25 && i < 30) {
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(59, 31, "hya");
}
if (i >= 30) {
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(59, 31, "ahya");
}
if (i >= 35) {
u8g2.setFont(u8g2_font_profont22_tr);
u8g2.drawStr(59, 31, "ahya");
u8g2.setFont(u8g2_font_5x8_tr);
u8g2.drawStr(60, 45, "C O D E S");
}
u8g2.sendBuffer();
delay(25);
}
updateDisplay();
}