Components and supplies
SSD1306 OLED Display
Arduino Mega 2560 Rev3
ELEGOO Upgraded 37 in 1 Sensor Modules Kit
Push Button
Box of 300 pcs 3-5 mm LED lights in various colors
Apps and platforms
Arduino IDE 2.0
Project description
Code
MiniComputer.ino
cpp
1/* 2 3 Mini Computer 4 by Keir Lahey 5 Current version: Sep 21, 2023 6 7*/ 8 9#include <RTClib.h> // Include libraries 10 11#include <DHT.h> 12#include <DHT_U.h> 13 14#include <Adafruit_SSD1306.h> 15#include "home_screen.h" 16#include "images.h" 17#include "game.h" 18 19Adafruit_SSD1306 disp(128, 64); // Define display & sensors 20DHT dht(39, DHT11); 21RTC_DS1307 rtc; 22 23#define LEFT 2 // Buttons 24#define RIGHT 8 25#define SELECT 5 26#define EXIT 11 27 28#define FLASHLIGHT 14 // Output devices 29#define AUDIO 23 30 31uint8_t left_current; // Current & previous states of LEFT 32uint8_t left_previous; 33 34uint8_t right_current; // Current & previous states of RIGHT 35uint8_t right_previous; 36 37uint8_t select_current; // Current & previous states of SELECT 38uint8_t select_previous; 39 40uint8_t exit_current; // Current & previous states of EXIT 41uint8_t exit_previous; 42 43const unsigned char icon[] PROGMEM = { // Program icon - a laptop 44 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xf8, 0x00, 0x40, 0x00, 0x08, 46 0x00, 0x5f, 0xff, 0xe8, 0x00, 0x50, 0x00, 0x28, 0x00, 0x57, 0xfe, 0x28, 0x00, 0x50, 0x00, 0x28, 47 0x00, 0x57, 0x80, 0x28, 0x00, 0x50, 0x00, 0x28, 0x00, 0x57, 0xf0, 0x28, 0x00, 0x50, 0x00, 0x28, 48 0x00, 0x5f, 0xc0, 0x28, 0x00, 0x40, 0x7f, 0xe8, 0x00, 0x7f, 0x80, 0x08, 0x00, 0x80, 0x7f, 0xf8, 49 0x01, 0x95, 0x00, 0x08, 0x06, 0x2a, 0xaa, 0x10, 0x0c, 0x55, 0x54, 0x60, 0x10, 0x00, 0x00, 0xc0, 50 0x20, 0x1f, 0x83, 0x00, 0x7f, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 52}; 53 54bool flashlight = false, audio = true, beep = true, booby_trap_mode = false; // Settings 55uint8_t speed = 1; // Music playback speed 56 57void buttonPressBase() { // Place this function at the start of every button click event 58 clicks++; 59 if (beep && audio) { // What mini computer sketch would be complete without a little 60 tone(AUDIO, 300, 40); // "beep" noise every time a button is pressed? Don't worry, you 61 } // can turn it off in Settings 62 63 if(booby_trap_mode){ // If this setting is on and someone touches this, you'll know 64 for(int i = 0; i < 40; i++){ 65 tone(AUDIO, 750, 100); 66 delay(150); 67 } 68 booby_trap_mode = false; 69 } 70} 71 72//digitalWrite() & pinMode() combined 73void digitalWriteAndPinMode(uint8_t pin, uint8_t val) { 74 pinMode(pin, OUTPUT); 75 digitalWrite(pin, val); 76} 77 78void setup() { 79 pinMode(LEFT, INPUT_PULLUP); // Setup buttons 80 digitalWriteAndPinMode(LEFT + 2, LOW); // Since the components attach directly to the board, extra code is required for powering them 81 pinMode(RIGHT, INPUT_PULLUP); 82 digitalWriteAndPinMode(RIGHT + 2, LOW); 83 pinMode(SELECT, INPUT_PULLUP); 84 digitalWriteAndPinMode(SELECT + 2, LOW); 85 pinMode(EXIT, INPUT_PULLUP); 86 digitalWriteAndPinMode(EXIT + 2, LOW); 87 88 pinMode(FLASHLIGHT, OUTPUT); // Setup flashlight 89 digitalWriteAndPinMode(FLASHLIGHT + 1, LOW); 90 pinMode(AUDIO, OUTPUT); // Setup audio 91 digitalWriteAndPinMode(27, LOW); 92 93 digitalWriteAndPinMode(18, LOW); // Setup RTC 94 digitalWriteAndPinMode(19, HIGH); 95 rtc.begin(); 96 97 disp.begin(SSD1306_SWITCHCAPVCC, 0x3c); // Begin communication with display 98 99 dht.begin(); // Setup DHT 100 digitalWriteAndPinMode(37, HIGH); 101 digitalWriteAndPinMode(35, LOW); 102 103 //rtc.adjust(DateTime([date & time go here])); // Set date & time on RTC. Uncomment this, upload this sketch, comment this again, then upload 1 last time 104 105 disp.setTextColor(WHITE); // Set text color and size 106 disp.setTextSize(1); 107 disp.setCursor(0, 0); 108 disp.setRotation(2); // The display is placed upside-down, so this makes everything display upside-down 109 110 disp.clearDisplay(); // Bootup screen 111 disp.setCursor(0, 0); 112 disp.println(F("Mini Computer!")); 113 disp.println(F("Sep 21, 2023")); 114 disp.drawBitmap(47, 31, icon, 32, 32, WHITE); // The laptop icon 115 disp.display(); 116 delay(2500); 117 118 left_previous = digitalRead(LEFT); 119 right_previous = digitalRead(RIGHT); 120 select_previous = digitalRead(SELECT); 121 exit_previous = digitalRead(EXIT); 122} 123 124void loop() { 125 home_screen_loop(); // See home_screen.ino 126}
clock.ino
cpp
1/* 2 3 clock.ino 4 Displays the time, also has a timer feature 5 6*/ 7 8void clock_loop() { 9 delay(300); // Wait 300 ms, to prevent instantly opening the timer 10 while (true) { // Infinite loop, to simulate the loop() function 11 left_current = digitalRead(LEFT); // Read buttons 12 right_current = digitalRead(RIGHT); 13 select_current = digitalRead(SELECT); 14 exit_current = digitalRead(EXIT); 15 16 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 17 clicks++; // No beep, but it'll still count as a click 18 } 19 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 20 clicks++; 21 } 22 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 23 buttonPressBase(); 24 timer_loop(); // Open timer 25 } 26 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 27 clicks++; 28 break; 29 } 30 31 disp.clearDisplay(); // Refresh display 32 disp.setCursor(0, 0); 33 disp.setTextSize(2); 34 35 DateTime now = rtc.now(); // Display time. For now, there are no trailing 0's. So: 03:06 = 3:6 36 if(now.hour() < 10){ // Leading 0 37 disp.print("0"); 38 } 39 disp.print(now.hour()); 40 disp.print(":"); 41 if(now.minute() < 10){ // Leading 0 42 disp.print("0"); 43 } 44 disp.print(now.minute()); 45 46 disp.setTextSize(1); 47 disp.println(F("\n\n")); 48 disp.println(F("Press SELECT to open timer")); 49 disp.display(); 50 51 left_previous = left_current; // Set previous button states 52 right_previous = right_current; 53 select_previous = select_current; 54 exit_previous = exit_current; 55 } 56}
timer.ino
cpp
1/* 2 3 timer.ino 4 A simple timer, part of the Clock app 5 6*/ 7 8uint32_t millis_start; // The time when the timer was started 9uint8_t time = 5; // The length of the timer (in mins) 10bool timer_started; // Is the timer started? 11 12void timer_loop() { 13 delay(300); // Wait 300 ms, to prevent the timer starting immediately 14 while (true) { 15 left_current = digitalRead(LEFT); // Read buttons 16 right_current = digitalRead(RIGHT); 17 select_current = digitalRead(SELECT); 18 exit_current = digitalRead(EXIT); 19 20 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 21 buttonPressBase(); 22 time--; 23 if (time < 1) { 24 time = 1; 25 } 26 } 27 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 28 buttonPressBase(); 29 time++; 30 if (time > 240) { 31 time = 240; 32 } 33 } 34 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 35 buttonPressBase(); 36 if (!timer_started) { 37 millis_start = millis(); 38 timer_started = true; 39 } 40 } 41 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 42 clicks++; // No beep, but it'll still count as a click 43 break; 44 } 45 46 uint8_t mins = time - floor((millis() - millis_start) / 60000.0); // Take care of timer stuff 47 if (timer_started && mins == 0) { // Time up! 48 if (audio) { 49 tone(AUDIO, 1000, 1000); 50 } 51 timer_started = false; // Make sure it doesn't think the timer is still going 52 delay(500); 53 } 54 55 disp.clearDisplay(); // Refresh display 56 disp.setCursor(0, 0); 57 if (timer_started) { 58 disp.println(F("Timer started!")); 59 disp.print(mins); 60 if (mins == 1) { // If 1 min is left: display "1 min left" instead of "1 mins left" 61 disp.println(F(" min left")); 62 } else { 63 disp.println(F(" mins left")); 64 } 65 } else { 66 disp.println(F("Set timer:")); 67 disp.print(time); 68 disp.println(F(" mins")); 69 } 70 disp.setTextSize(1); 71 disp.display(); 72 73 left_previous = left_current; // Set previous button states 74 right_previous = right_current; 75 select_previous = select_current; 76 exit_previous = exit_current; 77 } 78}
home_screen.h
cpp
1/* 2 3 home_screen.h - data about apps 4 5*/ 6 7#define APPS 11 // Number of apps 8int8_t current_app = 0; // The currently selected app 9uint16_t clicks = 0; // Amount of times you pressed a button - used in the Stats app 10 11String app_names[11] = { // The names of all the apps 12 "Clock", 13 "Calculator", 14 "Documents", 15 "Game", 16 "Music", 17 "Pictures", 18 "Settings", 19 "Temperature", 20 "Stats", 21 "Calendar", 22 "Info" 23}; 24 25const unsigned char home_screen[] PROGMEM = { // The home screen uses this background image for app icons. There is plenty of room for other apps, for if I think of another. 26 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 44 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x50, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 45 0x47, 0xe2, 0x4f, 0xf2, 0x4f, 0xf2, 0x4f, 0x02, 0x41, 0xc2, 0x40, 0x02, 0x40, 0x02, 0x51, 0x0a, 46 0x48, 0x12, 0x48, 0x12, 0x48, 0x12, 0x40, 0x82, 0x41, 0x22, 0x5f, 0xfa, 0x42, 0x82, 0x49, 0x12, 47 0x51, 0x0a, 0x4b, 0xd2, 0x4b, 0xd2, 0x4f, 0xf2, 0x41, 0x02, 0x50, 0x0a, 0x43, 0xc2, 0x40, 0x02, 48 0x51, 0x0a, 0x4b, 0xd2, 0x48, 0x12, 0x58, 0x1a, 0x41, 0x02, 0x50, 0x4a, 0x47, 0xf2, 0x43, 0xc2, 49 0x51, 0x0a, 0x48, 0x12, 0x4b, 0xd2, 0x52, 0x4a, 0x41, 0x02, 0x51, 0x0a, 0x4e, 0x62, 0x43, 0xda, 50 0x50, 0x8a, 0x4a, 0x92, 0x48, 0x12, 0x50, 0x0a, 0x41, 0x02, 0x53, 0xca, 0x46, 0x72, 0x5b, 0xc2, 51 0x50, 0x4a, 0x48, 0x12, 0x4b, 0xd2, 0x54, 0x2a, 0x41, 0x02, 0x57, 0xea, 0x4f, 0xe2, 0x43, 0xc2, 52 0x50, 0x0a, 0x49, 0x52, 0x48, 0x12, 0x51, 0x8a, 0x47, 0x02, 0x5f, 0xfa, 0x43, 0xc2, 0x40, 0x02, 53 0x48, 0x12, 0x48, 0x12, 0x48, 0x12, 0x52, 0x4a, 0x47, 0x02, 0x5f, 0xfa, 0x41, 0x42, 0x48, 0x92, 54 0x47, 0xe2, 0x4f, 0xf2, 0x4f, 0xf2, 0x5c, 0x3a, 0x47, 0x02, 0x40, 0x02, 0x40, 0x02, 0x50, 0x8a, 55 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 56 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 57 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 60 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 61 0x50, 0x02, 0x55, 0x52, 0x43, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 62 0x50, 0xc2, 0x5f, 0xfa, 0x43, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 63 0x50, 0xc2, 0x50, 0x0a, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 64 0x50, 0xda, 0x55, 0x4a, 0x43, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 65 0x50, 0xda, 0x50, 0x0a, 0x43, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 66 0x56, 0xda, 0x55, 0x4a, 0x43, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 67 0x56, 0xda, 0x50, 0x0a, 0x43, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 68 0x56, 0xda, 0x50, 0x0a, 0x43, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 69 0x50, 0x02, 0x5f, 0xfa, 0x43, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 70 0x5f, 0xfa, 0x40, 0x02, 0x43, 0x82, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 71 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 72 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 73 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 76 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 77 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 78 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 79 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 80 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 81 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 82 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 83 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 84 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 85 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 86 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 87 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 88 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 89 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 90};
home_screen.ino
cpp
1/* 2 3 home_screen.ino 4 You guessed it - this is the code for the home screen 5 6*/ 7 8void home_screen_loop() { // Main loop for the home screen 9 left_current = digitalRead(LEFT); // Read button states 10 right_current = digitalRead(RIGHT); 11 select_current = digitalRead(SELECT); 12 exit_current = digitalRead(EXIT); 13 14 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 15 buttonPressBase(); // The base code of every button press event. See the main file for details 16 current_app--; 17 if (current_app < 0) { // Make sure you don't select an app "-1", which doesn't exist 18 current_app = APPS - 1; // APPS - 1, because we start counting from 0 19 } 20 } 21 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 22 buttonPressBase(); 23 current_app++; 24 if (current_app >= APPS) { 25 current_app = 0; 26 } 27 } 28 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 29 buttonPressBase(); 30 switch (current_app) { // Open the selected app 31 case 0: // Clock 32 clock_loop(); 33 break; 34 case 1: // Calculator 35 calc_loop(); 36 break; 37 case 2: // Docs 38 docs_loop(); 39 break; 40 case 3: // Game 41 game_main_menu(); 42 break; 43 case 4: // Music 44 music_loop(); 45 break; 46 case 5: // Images 47 images_loop(); 48 break; 49 case 6: // Settings 50 settings_loop(); 51 break; 52 case 7: // Temperature and humidity 53 th_loop(); 54 break; 55 case 8: // Stats 56 stats_loop(); 57 break; 58 case 9: // Calendar 59 calendar_loop(); 60 break; 61 case 10: // Info 62 disp.clearDisplay(); // Being a small app, I decided to program it here, instead of in it's own seperate file 63 disp.setCursor(0, 0); 64 disp.println(F("Mini Computer")); 65 disp.println(F("Sep 21, 2023")); 66 disp.drawBitmap(47, 31, icon, 32, 32, WHITE); 67 disp.display(); 68 delay(2500); 69 break; 70 default: // Others - If there is no code for an app, this is used instead 71 ni_loop(); 72 break; 73 } 74 } 75 76 if (flashlight) { // Flashlight 77 digitalWrite(FLASHLIGHT, HIGH); 78 } else { 79 digitalWrite(FLASHLIGHT, LOW); 80 } 81 82 disp.clearDisplay(); // Refresh display 83 disp.setCursor(0, 0); 84 disp.drawBitmap(0, 0, home_screen, 128, 64, WHITE); // Base image 85 disp.drawRect((current_app % 8) * 16, 16 + (current_app / 8) * 16, 16, 16, WHITE); // The rect around the seleected app is thicker, so this draws a larger rect to do that 86 disp.print(app_names[current_app]); 87 disp.display(); 88 89 left_previous = left_current; // Set previous button states 90 right_previous = right_current; 91 select_previous = select_current; 92 exit_previous = exit_current; 93}
calculator.ino
cpp
1/* 2 3 calculator.ino 4 A simple calculator 5 6*/ 7 8const uint8_t PROGMEM calc_sprite[] = { // 12x8 calculator sprite 9 0b11111111, 10 0b11100001, 11 0b11111111, 12 0b10000001, 13 0b10000001, 14 0b11111111, 15 0b10101011, 16 0b11010101, 17 0b10101011, 18 0b11010101, 19 0b10101011, 20 0b11111111 21}; 22 23String opA = ""; // Operand A & B 24String opB = ""; 25float opA_final = 0; // opA & opB, converted to floats 26float opB_final = 0; 27float result = 0; // The final answer 28 29int8_t currentChracter; // Current character 30int8_t oper; // Operator 31 32uint8_t cursorTimer; // Timer used to blink the cursor (|) 33 34bool current_operand; // Are we editing opA (false) or opB (true)? 35bool answered; // Has the answer generated? 36 37char* charList = "0123456789.+-x/^"; // 0-9, +,-,x,/ 38char* charList2 = "0123456789.="; // 0-9, = 39char* charList3 = "lr"; // r=sqrt, l=log : operators 40 41// Draws the UI 42// length: the amount of buttons to print 43// charList: the list of characters displayed in the buttons 44void drawUI(uint8_t length, char* charList) { 45 for (uint8_t x = 0; x < length; x++) { // Draw buttons 46 if (currentChracter == x) { // If this is the selected button, highlight it 47 disp.fillRect(0 + (x * 8), 13, 9, 11, WHITE); 48 disp.setTextColor(BLACK); 49 } else { 50 disp.drawRect(0 + (x * 8), 13, 9, 11, WHITE); 51 disp.setTextColor(WHITE); 52 } 53 disp.setCursor(2 + (x * 8), 15); 54 disp.print(charList[x]); // Print the character corresponding to the button 55 } 56} 57 58// A special variant of drawUI - for charList3 59void drawUI3() { 60 for (uint8_t x = 0; x < 2; x++) { // Draw buttons 61 if (currentChracter - 16 == x) { 62 disp.fillRect(0 + (x * 24), 24, 25, 11, WHITE); 63 disp.setTextColor(BLACK); 64 } else { 65 disp.drawRect(0 + (x * 24), 24, 25, 11, WHITE); 66 disp.setTextColor(WHITE); 67 } 68 disp.setCursor(3 + (x * 24), 25); 69 switch (charList3[x]) { // These operators have displayed text longer than 1 character 70 case 'l': 71 disp.print(F("log")); 72 break; 73 case 'r': 74 disp.print(F("srt")); 75 break; 76 } 77 } 78} 79 80// Draw the "?" button 81void drawUIHelp() { 82 if (currentChracter == -1) { // The "?" button is -1 in the code 83 disp.fillRect(118, 52, 9, 11, WHITE); 84 disp.setTextColor(BLACK); 85 } else { 86 disp.drawRect(118, 52, 9, 11, WHITE); 87 disp.setTextColor(WHITE); 88 } 89 disp.setCursor(120, 54); 90 disp.print(F("?")); 91} 92 93void drawCursor() { // Draw cursor (|) 94 if (cursorTimer <= 6) { 95 disp.print(F("|")); 96 } 97} 98 99void calc_loop() { 100 delay(300); // Slight delay to prevent glitches. 101 while (true) { // Infinite loop to simulate the loop() function 102 left_current = digitalRead(LEFT); // Read button states 103 right_current = digitalRead(RIGHT); 104 select_current = digitalRead(SELECT); 105 exit_current = digitalRead(EXIT); 106 107 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 108 buttonPressBase(); 109 currentChracter++; 110 if (current_operand == false) { // If opA is being edited, there are 18 buttons 111 if (currentChracter >= 18) { 112 currentChracter = -1; 113 } 114 } else if (current_operand == true) { // If opB is being edited, there are only 12 buttons 115 if (currentChracter >= 12) { 116 currentChracter = -1; 117 } 118 } 119 } 120 121 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 122 buttonPressBase(); 123 currentChracter--; // Pretty simular to the code above 124 if (current_operand == false) { // opA 125 if (currentChracter < -1) { 126 currentChracter = 17; 127 } 128 } else if (current_operand == true) { // opB 129 if (currentChracter < -1) { 130 currentChracter = 11; 131 } 132 } 133 } 134 135 if (select_previous == HIGH && select_current == LOW) { // Enter button 136 buttonPressBase(); 137 138 if (currentChracter == -1) { // Help button, displays info about the calculator 139 disp.clearDisplay(); // Info 140 disp.setTextColor(WHITE); 141 disp.setCursor(0, 0); 142 disp.println(F("Very simple\ncalculator\n09-18-2023")); 143 disp.drawBitmap(2, 50, calc_sprite, 8, 12, WHITE); 144 disp.display(); 145 delay(2700); 146 147 disp.clearDisplay(); // What the operators are 148 disp.setCursor(0, 0); 149 disp.println(F("Operators:\nlog=log10, srt=sqrt")); 150 disp.drawBitmap(2, 50, calc_sprite, 8, 12, WHITE); 151 disp.display(); 152 delay(2700); 153 } 154 155 if (currentChracter < 11 && currentChracter > -1) { // If you pressed 0-9 or . 156 if (current_operand == false) { // opA 157 opA += charList[currentChracter]; 158 } else if (current_operand == true) { // opB 159 opB += charList[currentChracter]; 160 } 161 } 162 163 else if (current_operand == 0 && currentChracter < 16 && currentChracter > -1) { // +,-,x,/,^ - operators 164 oper = currentChracter; // Sets the operator to the one currently selected 165 currentChracter = 0; 166 current_operand = true; // move on the opB 167 } 168 169 ///// CALCULATE!!! ///// 170 else if (current_operand == false && currentChracter >= 16) { // log,sqrt - unary operators 171 opA_final = opA.toDouble(); // Since these are unary operators, you don't need opB 172 oper = currentChracter; // Sets the operator to the one currently selected 173 174 if (oper == 16) { // log10 175 result = log10(opA_final); 176 } else if (oper == 17) { // sqrt 177 result = sqrt(opA_final); 178 } 179 180 answered = true; 181 } 182 183 else if (current_operand == true && currentChracter == 11) { // = - for binary operators 184 opA_final = opA.toDouble(); // Convert the operands from strings to numbers 185 opB_final = opB.toDouble(); 186 187 if (oper == 11) { // + 188 result = opA_final + opB_final; 189 } else if (oper == 12) { // - 190 result = opA_final - opB_final; 191 } else if (oper == 13) { // x 192 result = opA_final * opB_final; 193 } else if (oper == 14) { // / 194 result = (double)opA_final / (double)opB_final; 195 } else if (oper == 15) { // ^ 196 result = pow(opA_final, opB_final); 197 } 198 199 answered = true; 200 } 201 } 202 203 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 204 clicks++; 205 break; 206 } 207 208 cursorTimer++; // Cursor timer stuff 209 if (cursorTimer > 12) { 210 cursorTimer = 0; 211 } 212 213 disp.clearDisplay(); // Refresh display 214 215 disp.setCursor(2, 2); 216 disp.setTextColor(WHITE); 217 disp.drawRect(0, 0, 128, 11, WHITE); // Text box 218 disp.drawBitmap(2, 50, calc_sprite, 8, 12, WHITE); // Calculator sprite 219 220 if (answered == true) { // If answer generated 221 if ((oper == 14 && opB_final == 0)) { // Divide by 0 222 disp.print(F("ERROR")); 223 } else { // Print the answer 224 if (result - floor(result) < 0.00001) { // If the result doesn't have a decimal, don't display it (eg. instead of 313.00000, display 313) 225 disp.print((double)result, 0); 226 } else { // Else, display a decimal 227 disp.print((double)result, 5); 228 } 229 } 230 drawUI(12, charList2); 231 drawUIHelp(); 232 disp.display(); 233 delay(6000); // Display answer for 6 seconds 234 235 answered = false; 236 opA_final = 0; 237 opB_final = 0; 238 opA = ""; 239 opB = ""; 240 currentChracter = 0; 241 current_operand = false; 242 } 243 244 else { // During typing 245 if (current_operand == false) { // opA 246 disp.print(opA); 247 drawCursor(); 248 drawUI(16, charList); 249 drawUI3(); 250 drawUIHelp(); 251 } else if (current_operand == true) { // opB 252 disp.print(opA); 253 if (oper == 11) { // Print operator 254 disp.print(F("+")); 255 } else if (oper == 12) { 256 disp.print(F("-")); 257 } else if (oper == 13) { 258 disp.print(F("x")); 259 } else if (oper == 14) { 260 disp.print(F("/")); 261 } else if (oper == 15) { 262 disp.print(F("^")); 263 } 264 disp.print(opB); 265 drawCursor(); 266 drawUI(12, charList2); 267 drawUIHelp(); 268 } 269 disp.display(); 270 } 271 272 left_previous = left_current; // Set previous button states 273 right_previous = right_current; 274 select_previous = select_current; 275 exit_previous = exit_current; 276 277 delay(20); 278 } 279}
docs.ino
cpp
1/* 2 3 docs.ino 4 Up to 4 documents can be displayed here 5 6*/ 7 8int8_t current_document; // Selected document 9 10void docs_loop() { 11 delay(300); // Slight delay to prevent glitches. 12 while (true) { 13 left_current = digitalRead(LEFT); // Read button states 14 right_current = digitalRead(RIGHT); 15 select_current = digitalRead(SELECT); 16 exit_current = digitalRead(EXIT); 17 18 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 19 buttonPressBase(); 20 current_document--; 21 if (current_document < 0) { 22 current_document = 3; 23 } 24 } 25 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 26 buttonPressBase(); 27 current_document++; 28 if (current_document >= 4) { 29 current_document = 0; 30 } 31 } 32 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 33 buttonPressBase(); 34 disp.clearDisplay(); 35 disp.setCursor(0, 0); 36 switch (current_document) { // Document contents 37 case 0: 38 disp.print(F("Sample text for document 1")); // You can replace this text with anything you want 39 break; 40 case 1: 41 disp.print(F("Sample text for document 2")); 42 break; 43 case 2: 44 disp.print(F("Sample text for document 3")); 45 break; 46 case 3: 47 disp.print(F("Sample text for document 4")); 48 break; 49 } 50 disp.display(); 51 delay(5000); // Display contents for 5 seconds 52 } 53 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 54 clicks++; 55 break; 56 } 57 58 disp.clearDisplay(); // Refresh display 59 disp.setCursor(0, 0); 60 disp.print(F("Documents")); 61 for (int i = 0; i < 4; i++) { 62 disp.drawRect(0, i * 12 + 12, 128, 12, WHITE); 63 disp.setCursor(2, i * 12 + 14); 64 if (current_document == i) { // Adds a ">" to the start of the selected documents name 65 disp.print(F(">")); 66 } 67 switch (i) { // Document names 68 case 0: 69 disp.print(F("Doc1")); // You can replace this text with anything you want 70 break; 71 case 1: 72 disp.print(F("Doc2")); 73 break; 74 case 2: 75 disp.print(F("Doc3")); 76 break; 77 case 3: 78 disp.print(F("Doc4")); 79 break; 80 } 81 } 82 disp.display(); 83 84 left_previous = left_current; // Set previous states 85 right_previous = right_current; 86 select_previous = select_current; 87 exit_previous = exit_current; 88 } 89}
game.h
cpp
1/* 2 3 game.h 4 The Point and Rect classes, as well as other game data 5 6*/ 7 8#include <math.h> 9#include <stdint.h> 10 11uint8_t difficulty = 1; // Difficulty. Controls the speed of the ball. Range: 1-5 12 13class Point { 14public: 15 int x; 16 int y; 17 bool simulated = true; 18 Point(int x_, int y_) { 19 x = x_; 20 y = y_; 21 } 22 Point() { 23 x = 0; 24 y = 0; 25 } 26 static bool Equals(Point a, Point b) { 27 if (a.x == b.x && a.y == b.y) { 28 return true; 29 } else { 30 return false; 31 } 32 } 33 float distanceTo(Point b){ 34 int distX = b.x - x; 35 int distY = b.y - y; 36 distX *= distX; 37 distY *= distY; 38 return sqrtf(distX + distY); 39 } 40}; 41 42class Rect { 43public: 44 int x; 45 int y; 46 int w; 47 int h; 48 bool simulated = true; 49 Rect(int x_, int y_, int w_, int h_) { 50 x = x_; 51 y = y_; 52 w = w_; 53 h = h_; 54 } 55 Rect(Point origin, int w_, int h_) { 56 x = origin.x; 57 y = origin.y; 58 w = w_; 59 h = h_; 60 } 61 Rect() { 62 x = 0; 63 y = 0; 64 w = 0; 65 h = 0; 66 } 67 bool pointInRect(Point otherPoint, int rectInflation = 0) { 68 if ( 69 (otherPoint.x >= x - rectInflation && 70 otherPoint.x <= x + w + rectInflation) && 71 (otherPoint.y >= y - rectInflation && 72 otherPoint.y <= y + h + rectInflation)) { 73 return true; 74 } else { 75 return false; 76 } 77 } 78 bool touching(Rect otherRect, int rectInflation = 0) { 79 if ( 80 pointInRect(Point(otherRect.x, otherRect.y), rectInflation) || 81 pointInRect(Point(otherRect.x + otherRect.w, otherRect.y), rectInflation) || 82 pointInRect(Point(otherRect.x, otherRect.y + otherRect.h), rectInflation) || 83 pointInRect(Point(otherRect.x + otherRect.w, otherRect.y + otherRect.h), rectInflation)) { 84 return true; 85 } else { 86 return false; 87 } 88 } 89};
game.ino
cpp
1/* 2 3 game.ino 4 The Game app itself. A Breakout style game 5 6*/ 7 8Rect blocks[25]; // Blocks 9 10Rect ball; 11bool ball_dir_x; // Direction of ball in x axis: false=left, true=right 12bool ball_dir_y; // Direction of ball in y axis: false=up, true=down 13bool lost; // Have you lost the game? 14Rect paddle; 15 16uint16_t score; 17 18void game_start() { 19 randomSeed(analogRead(5) - millis()); // Set seed for random number 20 uint8_t x = 103; // Setup blocks 21 uint8_t y = 2; 22 for (uint8_t i = 0; i < 25; i++) { 23 blocks[i] = Rect(x, y, 3, 10); 24 blocks[i].simulated = true; 25 x += 5; 26 if (x > 123) { 27 x = 103; 28 y += 12; 29 } 30 } 31 ball = Rect(random(61, 65), random(30, 32), 2, 2); // Setup ball, paddle & score 32 paddle = Rect(1, 4, 2, 8); 33 score = 0; 34} 35 36void game_loop() { 37 delay(300); // Wait 300 ms, to prevent glitches 38 while (true) { 39 if (millis() % 50 < 4) { // Attempts to keep the frame rate down to 20 fps 40 left_current = digitalRead(LEFT); // Read button states 41 right_current = digitalRead(RIGHT); 42 select_current = digitalRead(SELECT); 43 exit_current = digitalRead(EXIT); 44 45 //paddle.y = ball.y - 4; // For cheat mode 46 47 if (left_current == LOW) { // If left button pressed - as long as button stays pressed, event executes 48 paddle.y -= 2; // Move paddle down 49 if (paddle.y < 0) { 50 paddle.y = 0; 51 } 52 } 53 if (right_current == LOW) { // If right button pressed - as long as button stays pressed, event executes 54 paddle.y += 2; // Move paddle up 55 if (paddle.y + paddle.h > 63) { 56 paddle.y = 63 - paddle.h; 57 } 58 } 59 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 60 buttonPressBase(); 61 } 62 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 63 clicks++; 64 break; 65 } 66 67 for (int i = 0; i < difficulty; i++) { // Update ball position 68 ball.x += ball_dir_x ? 1 : -1; 69 ball.y += ball_dir_y ? 1 : -1; 70 71 if (ball.x < 0) { // If the ball is not caught by the paddle, you lose 72 disp.setCursor(5, 5); 73 disp.clearDisplay(); 74 disp.print(F("YOU LOSE")); 75 disp.display(); 76 tone(AUDIO, 100, 300); 77 delay(2000); 78 79 lost = true; 80 break; // Break out (no pun intended) of the for loop, so at higher difficulties, the message doesn't show multiple times 81 } 82 83 if (ball.y <= 0 || ball.y >= 63) { // If the ball hits the top or bottom wall 84 ball_dir_y = !ball_dir_y; 85 tone(AUDIO, 200, 50); 86 } 87 if (ball.x >= 127) { // If the ball hits the right wall 88 ball_dir_x = false; // The ball should always bounce left 89 tone(AUDIO, 200, 50); 90 } 91 92 if (ball.touching(paddle, 1)) { // If ball touches paddle 93 ball_dir_x = true; // The ball should always bounce right 94 ball.x++; // Sometimes the ball seems to get "stuck" on the paddle for a bit, so this should help fix it 95 tone(AUDIO, 200, 50); 96 } 97 for (uint8_t j = 0; j < 25; j++) { // Check if ball touches a block 98 if (blocks[j].simulated && blocks[j].touching(ball)) { 99 tone(AUDIO, 300 + (score * 4), 50); // Pitch increases with score 100 score++; 101 blocks[j].simulated = false; 102 ball_dir_x = !ball_dir_x; 103 } 104 } 105 } 106 107 if (lost) { // If you lost the game 108 lost = false; 109 break; 110 } 111 112 disp.clearDisplay(); // Refresh display 113 114 disp.drawRect(-1, 0, 129, 64, WHITE); // Draw wall 115 for (uint8_t i = 0; i < 25; i++) { // Draw blocks 116 if (blocks[i].simulated) { 117 disp.fillRect(blocks[i].x, blocks[i].y, blocks[i].w, blocks[i].h, WHITE); 118 } 119 } 120 disp.fillRect(ball.x, ball.y, ball.w, ball.h, WHITE); // Draw ball 121 disp.fillRect(paddle.x, paddle.y, paddle.w, paddle.h, WHITE); // Draw paddle 122 123 disp.setCursor(0, 53); // Score 124 disp.print("Score:"); 125 disp.print(score); 126 127 disp.display(); 128 129 left_previous = left_current; // Set previous button states 130 right_previous = right_current; 131 select_previous = select_current; 132 exit_previous = exit_current; 133 } 134 } 135}
songs.ino
cpp
1/* 2 3 songs.ino 4 The songs in the Music app are defined here 5 6*/ 7 8#include <pitches.h> 9 10// Basically the tone() function, but with delay. Speed is adjusted with the speed variable 11void play_note(int freq, int dur) { 12 tone(AUDIO, freq, dur / speed); 13 delay((dur / speed) * 1.1); 14} 15 16void c_major() { 17 if (audio) { 18 play_note(NOTE_C4, 250); 19 play_note(NOTE_D4, 250); 20 play_note(NOTE_E4, 250); 21 play_note(NOTE_F4, 250); 22 play_note(NOTE_G4, 250); 23 play_note(NOTE_A4, 250); 24 play_note(NOTE_B4, 250); 25 play_note(NOTE_C5, 500); 26 27 28 play_note(NOTE_C5, 250); 29 play_note(NOTE_B4, 250); 30 play_note(NOTE_A4, 250); 31 play_note(NOTE_G4, 250); 32 play_note(NOTE_F4, 250); 33 play_note(NOTE_E4, 250); 34 play_note(NOTE_D4, 250); 35 play_note(NOTE_C4, 500); 36 } 37} 38 39void twinkle_twinkle() { 40 if (audio) { 41 play_note(NOTE_C4, 500); 42 play_note(NOTE_C4, 500); 43 play_note(NOTE_G4, 500); 44 play_note(NOTE_G4, 500); 45 play_note(NOTE_A4, 500); 46 play_note(NOTE_A4, 500); 47 play_note(NOTE_G4, 1000); 48 49 play_note(NOTE_F4, 500); 50 play_note(NOTE_F4, 500); 51 play_note(NOTE_E4, 500); 52 play_note(NOTE_E4, 500); 53 play_note(NOTE_D4, 500); 54 play_note(NOTE_D4, 500); 55 play_note(NOTE_C4, 1000); 56 57 for(int i = 0; i < 2; i++){ 58 play_note(NOTE_G4, 500); 59 play_note(NOTE_G4, 500); 60 play_note(NOTE_F4, 500); 61 play_note(NOTE_F4, 500); 62 play_note(NOTE_E4, 500); 63 play_note(NOTE_E4, 500); 64 play_note(NOTE_D4, 1000); 65 } 66 67 play_note(NOTE_C4, 500); 68 play_note(NOTE_C4, 500); 69 play_note(NOTE_G4, 500); 70 play_note(NOTE_G4, 500); 71 play_note(NOTE_A4, 500); 72 play_note(NOTE_A4, 500); 73 play_note(NOTE_G4, 1000); 74 75 play_note(NOTE_F4, 500); 76 play_note(NOTE_F4, 500); 77 play_note(NOTE_E4, 500); 78 play_note(NOTE_E4, 500); 79 play_note(NOTE_D4, 500); 80 play_note(NOTE_D4, 500); 81 play_note(NOTE_C4, 1000); 82 } 83}
images.ino
cpp
1/* 2 3 images.ino 4 Up to 4 images can be displayed here 5 6*/ 7 8int8_t current_image; // The selected image 9 10void images_loop() { 11 delay(300); // Slight delay to prevent glitches. 12 while (true) { 13 left_current = digitalRead(LEFT); // Read buttons states 14 right_current = digitalRead(RIGHT); 15 select_current = digitalRead(SELECT); 16 exit_current = digitalRead(EXIT); 17 18 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 19 buttonPressBase(); 20 current_image--; 21 if (current_image < 0) { 22 current_image = 3; 23 } 24 } 25 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 26 buttonPressBase(); 27 current_image++; 28 if (current_image >= 4) { 29 current_image = 0; 30 } 31 } 32 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 33 buttonPressBase(); 34 disp.clearDisplay(); 35 disp.setCursor(0, 0); 36 switch (current_image) { // Images 37 case 0: 38 disp.drawBitmap(0, 0, arduino_image, 128, 64, WHITE); // Sample image 39 break; 40 case 1: 41 //disp.drawBitmap(0, 0, [Your Image Here], 128, 64, WHITE); // Place custom images here 42 break; 43 case 2: 44 //disp.drawBitmap(0, 0, [Your Image Here], 128, 64, WHITE); 45 break; 46 case 3: 47 //disp.drawBitmap(0, 0, [Your Image Here], 128, 64, WHITE); 48 break; 49 } 50 disp.display(); 51 delay(5000); // Images are displayed for 5 seconds 52 } 53 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 54 clicks++; 55 break; 56 } 57 58 disp.clearDisplay(); // Refresh display 59 disp.setCursor(0, 0); 60 disp.print(F("Pictures")); 61 for (int i = 0; i < 4; i++) { 62 disp.drawRect(0, i * 12 + 12, 128, 12, WHITE); 63 disp.setCursor(2, i * 12 + 14); 64 if (current_image == i) { // Adds a ">" to the start of the selected images name 65 disp.print(F(">")); 66 } 67 switch (i) { // Image names 68 case 0: 69 disp.print(F("Arduino")); 70 break; 71 case 1: 72 disp.print(F("")); // If you make custom images, make sure to give them names 73 break; 74 case 2: 75 disp.print(F("")); 76 break; 77 case 3: 78 disp.print(F("")); 79 break; 80 } 81 } 82 disp.display(); 83 84 left_previous = left_current; // Set previous states 85 right_previous = right_current; 86 select_previous = select_current; 87 exit_previous = exit_current; 88 } 89}
settings.ino
cpp
1/* 2 3 settings.ino 4 Flashlight, audio and beep can be turned on or off here 5 6*/ 7 8int8_t current_setting; 9 10void settings_loop() { 11 delay(300); // Slight delay to prevent glitches. 12 while (true) { 13 left_current = digitalRead(LEFT); // Read button states 14 right_current = digitalRead(RIGHT); 15 select_current = digitalRead(SELECT); 16 exit_current = digitalRead(EXIT); 17 18 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 19 buttonPressBase(); 20 current_setting--; 21 if (current_setting < 0) { 22 current_setting = 3; 23 } 24 } 25 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 26 buttonPressBase(); 27 current_setting++; 28 if (current_setting >= 4) { 29 current_setting = 0; 30 } 31 } 32 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 33 buttonPressBase(); 34 switch (current_setting) { 35 case 0: 36 flashlight = !flashlight; 37 break; 38 case 1: 39 audio = !audio; 40 break; 41 case 2: 42 beep = !beep; 43 break; 44 case 3: 45 booby_trap_mode = !booby_trap_mode; 46 break; 47 } 48 } 49 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 50 clicks++; 51 break; 52 } 53 54 if (flashlight) { // Flashlight 55 digitalWrite(FLASHLIGHT, HIGH); 56 } else { 57 digitalWrite(FLASHLIGHT, LOW); 58 } 59 60 disp.clearDisplay(); // Refresh display 61 disp.setCursor(0, 0); 62 disp.print(F("Settings")); 63 for (int i = 0; i < 4; i++) { 64 disp.setCursor(2, i * 12 + 14); 65 disp.drawRect(0, i * 12 + 12, 128, 12, WHITE); 66 if (current_setting == i) { // Adds a ">" to the start of the selected settings name 67 disp.print(F(">")); 68 } 69 switch (i) { // Setting names and states 70 case 0: 71 disp.print(F("Flashlight - ")); 72 disp.print(flashlight ? "on" : "off"); 73 break; 74 case 1: 75 disp.print(F("Audio - ")); 76 disp.print(audio ? "on" : "off"); 77 break; 78 case 2: 79 disp.print(F("Beep - ")); 80 disp.print(beep ? "on" : "off"); 81 break; 82 case 3: 83 disp.print(F("Booby trap - ")); 84 disp.print(booby_trap_mode ? "on" : "off"); 85 break; 86 } 87 } 88 disp.display(); 89 90 left_previous = left_current; // Set previous states 91 right_previous = right_current; 92 select_previous = select_current; 93 exit_previous = exit_current; 94 } 95}
stats.ino
cpp
1/* 2 3 stats.ino 4 millis() and amount of clicks are displayed here 5 6*/ 7 8void stats_loop() { 9 delay(300); // Slight delay to prevent glitches. 10 while (true) { 11 left_current = digitalRead(LEFT); // Read button states 12 right_current = digitalRead(RIGHT); 13 select_current = digitalRead(SELECT); 14 exit_current = digitalRead(EXIT); 15 16 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 17 clicks++; 18 } 19 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 20 clicks++; 21 } 22 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 23 clicks++; 24 } 25 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 26 clicks++; 27 break; 28 } 29 30 disp.clearDisplay(); 31 disp.setCursor(0, 0); 32 disp.print(F("millis():")); 33 disp.println(millis()); 34 disp.print(F("Clicks:")); 35 disp.println(clicks); 36 disp.display(); 37 38 left_previous = left_current; // Set previous states 39 right_previous = right_current; 40 select_previous = select_current; 41 exit_previous = exit_current; 42 } 43}
music.ino
cpp
1/* 2 3 music.ino 4 Plays 1 bit songs at 6 different speeds 5 6*/ 7 8int8_t current_song; 9 10void music_loop() { 11 delay(300); // Slight delay to prevent glitches. 12 while (true) { 13 left_current = digitalRead(LEFT); // Read button states 14 right_current = digitalRead(RIGHT); 15 select_current = digitalRead(SELECT); 16 exit_current = digitalRead(EXIT); 17 18 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 19 buttonPressBase(); 20 current_song--; 21 if (current_song < 0) { 22 current_song = 3; 23 } 24 } 25 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 26 buttonPressBase(); 27 current_song++; 28 if (current_song >= 4) { 29 current_song = 0; 30 } 31 } 32 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 33 buttonPressBase(); 34 switch (current_song) { 35 case 0: 36 c_major(); 37 break; 38 case 1: 39 twinkle_twinkle(); 40 break; 41 case 2: 42 // custom music here 43 break; 44 case 3: // Speed 45 speed *= 2; 46 if(speed > 32){ 47 speed = 1; 48 } 49 break; 50 } 51 } 52 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 53 clicks++; 54 break; 55 } 56 57 disp.clearDisplay(); // Refresh display 58 disp.setCursor(0, 0); 59 disp.print(F("Music")); 60 for (int i = 0; i < 4; i++) { 61 disp.drawRect(0, i * 12 + 12, 128, 12, WHITE); 62 disp.setCursor(2, i * 12 + 14); 63 if (current_song == i) { // Adds a ">" to the start of the selected songs name 64 disp.print(F(">")); 65 } 66 switch (i) { 67 case 0: 68 disp.print(F("C major scale")); 69 break; 70 case 1: 71 disp.print(F("Twinkle twinkle")); 72 break; 73 case 2: 74 // disp.print(F("Custom song name")); 75 break; 76 case 3: 77 disp.print(F("Speed: ")); 78 disp.print(speed); 79 break; 80 } 81 } 82 disp.display(); 83 84 left_previous = left_current; // Set previous states 85 right_previous = right_current; 86 select_previous = select_current; 87 exit_previous = exit_current; 88 } 89}
temp_and_hmdt.ino
cpp
1/* 2 3 temp_and_hmdt.ino 4 Temperature & humidity from DHT11 sensor 5 6*/ 7 8void th_loop() { 9 delay(300); // Slight delay to prevent glitches. 10 while (true) { 11 left_current = digitalRead(LEFT); // Read button states 12 right_current = digitalRead(RIGHT); 13 select_current = digitalRead(SELECT); 14 exit_current = digitalRead(EXIT); 15 16 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 17 clicks++; 18 } 19 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 20 clicks++; 21 } 22 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 23 clicks++; 24 } 25 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 26 clicks++; 27 break; 28 } 29 30 float t = dht.readTemperature(); // Read temperature & humidity from the DHT11 31 float h = dht.readHumidity(); 32 33 disp.clearDisplay(); // Refresh display 34 disp.setCursor(0, 0); 35 36 disp.println(F("Temperture: ")); // Temperature 37 disp.print(t, 1); 38 disp.println(F("oC")); 39 disp.drawRect(0, 16, 127, 5, WHITE); // A bar that shows the temprature. Range: 0-40oC 40 disp.fillRect(0, 16, (t / 40.0) * 127, 5, WHITE); 41 42 disp.println(F("\nHumidity: ")); // Humidity 43 disp.print(h, 1); 44 disp.println(F("%")); 45 disp.drawRect(0, 40, 127, 5, WHITE); // A bar that shows the humidity. Range: 0-100% 46 disp.fillRect(0, 40, (h / 100.0) * 127, 5, WHITE); 47 48 disp.display(); 49 50 left_previous = left_current; // Set previous states 51 right_previous = right_current; 52 select_previous = select_current; 53 exit_previous = exit_current; 54 } 55}
calendar.ino
cpp
1/* 2 3 calendar.ino 4 A calendar for Sep-Dec 2023 5 If you are planning on making this, be sure to check back yearly for updates 6 7*/ 8 9#define YEAR 2023 // As of app creation, it's 2023, and will be for 3 months longer 10 11#define SUN 0 // Days of week 12#define MON 1 13#define TUS 2 14#define WED 3 15#define THU 4 16#define FRI 5 17#define SAT 6 18 19#define FIRST_OF_SEP FRI // Sep 1, 2023 was on a Friday 20#define FIRST_OF_OCT SUN // Oct 1, 2023 was on a Sunday 21#define FIRST_OF_NOV WED // Nov 1, 2023 was... you get it 22#define FIRST_OF_DEC FRI 23 24uint8_t displayed_month = 9; // The current month being displayed 25uint8_t current_month; // The month today is in. Do not get confused with displayed_month, see above 26uint8_t current_day; // The current day 27 28void draw_calendar(uint8_t first_of_month, uint8_t number_of_days){ // Draws the calendar (except for days of week) 29 for (int i = 0; i < number_of_days; i++) { 30 uint8_t x = ((i + first_of_month) % 7) * 18; // Complex looking math for positions of the days 31 uint8_t y = 16 + ((i + first_of_month) / 7) * 8; 32 if (current_day == i + 1 && current_month == displayed_month) { // If day being displayed is today 33 disp.setTextColor(BLACK, WHITE); 34 } else { 35 disp.setTextColor(WHITE, BLACK); 36 } 37 disp.setCursor(x, y); 38 disp.print(i + 1); // Because i is off by 1, we have to add 1 to i so it lines up with the days of the month 39 } 40} 41 42void calendar_loop() { 43 delay(300); // Slight delay to prevent glitches. 44 while (true) { 45 left_current = digitalRead(LEFT); // Read button states 46 right_current = digitalRead(RIGHT); 47 select_current = digitalRead(SELECT); 48 exit_current = digitalRead(EXIT); 49 50 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 51 buttonPressBase(); 52 displayed_month --; 53 if(displayed_month < 9){ 54 displayed_month = 9; 55 } 56 } 57 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 58 buttonPressBase(); 59 displayed_month ++; 60 if(displayed_month > 12){ 61 displayed_month = 12; 62 } 63 } 64 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 65 clicks++; 66 } 67 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 68 clicks++; 69 break; 70 } 71 72 DateTime now = rtc.now(); // Get data about the month and day from RTC 73 current_day = now.day(); 74 current_month = now.month(); 75 76 disp.clearDisplay(); // Refresh display 77 disp.setCursor(0, 0); 78 switch(displayed_month){ // Convert month number to 3 letter abbreviation 79 case 8: 80 disp.print(F("Aug")); 81 break; 82 case 9: 83 disp.print(F("Sep")); 84 break; 85 case 10: 86 disp.print(F("Oct")); 87 break; 88 case 11: 89 disp.print(F("Nov")); 90 break; 91 case 12: 92 disp.print(F("Dec")); 93 break; 94 } 95 disp.print(" "); 96 disp.println(YEAR); 97 disp.println(F("Su Mo Tu We Th Fr Sa")); // The days of the week 98 99 switch(displayed_month){ // Draw calender 100 case 9: 101 draw_calendar(FIRST_OF_SEP, 30); 102 break; 103 case 10: 104 draw_calendar(FIRST_OF_OCT, 31); 105 break; 106 case 11: 107 draw_calendar(FIRST_OF_NOV, 30); 108 break; 109 case 12: 110 draw_calendar(FIRST_OF_DEC, 31); 111 break; 112 } 113 114 disp.display(); 115 116 left_previous = left_current; // Set previous button states 117 right_previous = right_current; 118 select_previous = select_current; 119 exit_previous = exit_current; 120 } 121}
game_main_menu.ino
cpp
1/* 2 3 game_main_menu.ino 4 Main menu for the Game app 5 6*/ 7 8void game_main_menu() { // Main menu of the game 9 delay(300); // Wait 300 ms, to prevent glitches 10 while (true) { 11 left_current = digitalRead(LEFT); // Read button states 12 right_current = digitalRead(RIGHT); 13 select_current = digitalRead(SELECT); 14 exit_current = digitalRead(EXIT); 15 16 if (left_previous == HIGH && left_current == LOW) { // If left button pressed 17 buttonPressBase(); 18 difficulty--; 19 if(difficulty < 1){ 20 difficulty = 1; 21 } 22 } 23 if (right_previous == HIGH && right_current == LOW) { // If right button pressed 24 buttonPressBase(); 25 difficulty++; 26 if(difficulty > 5){ 27 difficulty = 5; 28 } 29 } 30 if (select_previous == HIGH && select_current == LOW) { // If select button pressed 31 buttonPressBase(); 32 game_start(); // Unlike most apps, this game needs initial setup 33 game_loop(); 34 } 35 if (exit_previous == HIGH && exit_current == LOW) { // If exit button pressed 36 clicks++; 37 break; 38 } 39 40 disp.clearDisplay(); // Refresh display 41 disp.setCursor(0, 0); 42 disp.print(F("Difficulty: ")); 43 disp.print(difficulty); 44 disp.fillRect(0, 16, 34, 12, WHITE); // Start button 45 disp.setCursor(2, 18); 46 disp.setTextColor(BLACK); 47 disp.print(F("Start")); 48 disp.setTextColor(WHITE); 49 disp.display(); 50 51 left_previous = left_current; // Set previous button states 52 right_previous = right_current; 53 select_previous = select_current; 54 exit_previous = exit_current; 55 } 56}
images.h
cpp
1/* 2 3 images.h 4 Define images here. There is a sample image of the Arduino Mega too. 5 6*/ 7 8const unsigned char arduino_image[] PROGMEM = { 9 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x84, 0x00, 0x00, 0x00, 11 0x00, 0x00, 0x00, 0x00, 0xb0, 0x10, 0x03, 0x56, 0xd3, 0xdb, 0x44, 0x04, 0x96, 0x10, 0x00, 0x00, 12 0x00, 0x00, 0x00, 0x04, 0x90, 0x92, 0x42, 0x52, 0x52, 0x49, 0x01, 0x84, 0x10, 0x00, 0x00, 0x00, 13 0x00, 0x00, 0x00, 0x04, 0x97, 0xff, 0x7f, 0xde, 0xff, 0xff, 0xc0, 0x20, 0x4f, 0xf0, 0x24, 0x00, 14 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 15 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x30, 0x00, 0x00, 0x03, 0x14, 0x00, 16 0x00, 0x03, 0xff, 0x92, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x30, 0x00, 0x00, 0x03, 0x00, 0x00, 17 0x01, 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 18 0x3f, 0xff, 0xf0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x02, 0x02, 0x00, 19 0x3f, 0xff, 0xf0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x1f, 0x00, 0x00, 20 0x3f, 0xff, 0xf8, 0x70, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0x00, 0x00, 0x3f, 0x00, 0x00, 21 0x3f, 0xff, 0xf8, 0x60, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0x00, 0x00, 0x2f, 0x00, 0x00, 22 0x3f, 0xff, 0xf7, 0x70, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x7f, 0x00, 0x00, 23 0x7f, 0xff, 0xf2, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x7e, 0x02, 0x00, 24 0x7f, 0xff, 0xe1, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x7f, 0x80, 0x00, 25 0x7f, 0xff, 0xe9, 0xe0, 0x20, 0x60, 0x00, 0x10, 0x00, 0x01, 0xf6, 0x00, 0x00, 0x7f, 0x00, 0x00, 26 0x7f, 0xff, 0xe1, 0x63, 0x60, 0xe0, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf8, 0x00, 0x7b, 0x80, 0x00, 27 0x7f, 0xff, 0xe9, 0xfb, 0x60, 0xe1, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xfb, 0x80, 0x00, 28 0x7f, 0xff, 0xef, 0x5f, 0x60, 0xfa, 0x00, 0x00, 0x00, 0x38, 0x21, 0x40, 0x00, 0x13, 0x80, 0x00, 29 0xff, 0xff, 0xe1, 0xcb, 0xe7, 0xe4, 0x00, 0x78, 0x00, 0x00, 0x00, 0xc3, 0x18, 0x1b, 0x80, 0x00, 30 0x00, 0x00, 0x01, 0xc3, 0xee, 0xe0, 0x00, 0x4f, 0x53, 0x80, 0x02, 0x47, 0x98, 0x10, 0x00, 0x00, 31 0x00, 0x00, 0x09, 0xc7, 0xf7, 0xf0, 0x00, 0x9f, 0xff, 0xc0, 0x00, 0x17, 0xbc, 0x01, 0x80, 0x00, 32 0x00, 0x00, 0x01, 0xcf, 0xfe, 0xd8, 0x00, 0xff, 0xff, 0xe0, 0x80, 0xcf, 0x80, 0x09, 0x80, 0x40, 33 0x00, 0x00, 0x0b, 0xcf, 0xff, 0xe8, 0x03, 0xff, 0xff, 0xf8, 0x00, 0x03, 0x80, 0x08, 0x00, 0x00, 34 0x00, 0x00, 0x02, 0x5f, 0xff, 0xe8, 0x03, 0xff, 0xff, 0xf8, 0xb0, 0xff, 0xfe, 0x0b, 0xc0, 0x20, 35 0x00, 0x00, 0x00, 0x07, 0xff, 0xe8, 0x07, 0xff, 0xff, 0xfc, 0xfc, 0xbf, 0xe0, 0x09, 0x00, 0x00, 36 0x00, 0x03, 0x03, 0xc0, 0x19, 0xe8, 0x07, 0xff, 0xff, 0xf9, 0xb5, 0xff, 0xfc, 0x09, 0xc0, 0x20, 37 0x00, 0x00, 0x03, 0xe1, 0xfd, 0xf8, 0x0f, 0xff, 0xff, 0xf9, 0xb5, 0xff, 0xff, 0x0d, 0xf0, 0x00, 38 0x00, 0x00, 0x03, 0xff, 0xff, 0x3c, 0x04, 0xff, 0xff, 0xf8, 0xf5, 0xff, 0xff, 0x0e, 0x30, 0x00, 39 0x00, 0x07, 0x80, 0xff, 0xfa, 0x3c, 0x01, 0xff, 0xff, 0xf8, 0x90, 0xff, 0xff, 0x0d, 0xf8, 0x00, 40 0x00, 0x00, 0x00, 0xff, 0xf9, 0xdc, 0x0f, 0xff, 0xff, 0xf8, 0xb4, 0xbf, 0xc0, 0x08, 0xf0, 0x00, 41 0x00, 0x06, 0x0d, 0xff, 0xfd, 0xd8, 0x1f, 0xff, 0xff, 0xfe, 0xb4, 0xff, 0xc0, 0x04, 0x10, 0x00, 42 0x00, 0x07, 0x21, 0xff, 0x9d, 0xf8, 0x3a, 0xff, 0xff, 0xff, 0xa0, 0x40, 0x7c, 0x06, 0xf0, 0x00, 43 0x00, 0x07, 0x09, 0x80, 0x1e, 0x38, 0x30, 0xff, 0xff, 0xff, 0x00, 0x00, 0x38, 0x04, 0x10, 0x00, 44 0x00, 0x0f, 0x00, 0x40, 0x00, 0x18, 0x09, 0xff, 0xff, 0xfe, 0x02, 0x35, 0x80, 0x04, 0x70, 0x10, 45 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3f, 0xff, 0xff, 0xf8, 0x03, 0xb1, 0x80, 0x04, 0xf8, 0x10, 46 0x00, 0x00, 0x00, 0x01, 0x83, 0xd8, 0x2c, 0xdf, 0xff, 0x8a, 0x07, 0xf8, 0x7c, 0x04, 0x10, 0x00, 47 0x00, 0x00, 0x80, 0x39, 0x83, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xff, 0x04, 0xf8, 0x00, 48 0x00, 0x01, 0x8f, 0x31, 0x80, 0x00, 0x30, 0x1f, 0xff, 0xc0, 0x00, 0x93, 0x00, 0x04, 0x68, 0x00, 49 0x00, 0x07, 0x86, 0x00, 0x00, 0x00, 0x00, 0x15, 0x91, 0x42, 0x00, 0x00, 0x00, 0x04, 0x08, 0x00, 50 0x00, 0x07, 0x8e, 0xcc, 0x03, 0xc0, 0x04, 0xc0, 0x00, 0x00, 0xf3, 0xf3, 0xf0, 0x04, 0x68, 0x08, 51 0x38, 0x07, 0x8e, 0x8f, 0xe2, 0x40, 0x00, 0x00, 0x00, 0x00, 0xf3, 0xff, 0xf8, 0x07, 0x78, 0x00, 52 0x38, 0x0f, 0x84, 0x9f, 0x43, 0xc1, 0xd8, 0x00, 0x00, 0x00, 0xfb, 0xfe, 0xd8, 0x03, 0x08, 0x00, 53 0x38, 0x0f, 0x0e, 0x1e, 0x03, 0xc3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x03, 0x7e, 0x08, 54 0x33, 0xff, 0xc2, 0x34, 0x1f, 0xc2, 0x1f, 0x00, 0x00, 0x00, 0xfd, 0x99, 0x00, 0x03, 0x38, 0x00, 55 0x37, 0xff, 0xcc, 0x7c, 0x7f, 0xe3, 0xdb, 0x00, 0x00, 0x00, 0xbe, 0xbf, 0xbc, 0x03, 0xfc, 0x00, 56 0x37, 0xff, 0xc8, 0xfe, 0xff, 0x03, 0xca, 0x00, 0x00, 0x00, 0xff, 0xbf, 0xfc, 0x03, 0xfe, 0x00, 57 0x70, 0x00, 0x61, 0xff, 0xff, 0x01, 0xc0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x03, 0xb4, 0x00, 58 0x20, 0x00, 0x21, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf4, 0x00, 59 0x70, 0x00, 0x1f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf6, 0x00, 60 0x10, 0x00, 0x1f, 0x71, 0x81, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfe, 0x34, 0x00, 61 0x00, 0x00, 0x1f, 0x01, 0x80, 0x34, 0xff, 0xfc, 0x3f, 0xff, 0xe1, 0xfe, 0xca, 0x01, 0xf4, 0x0c, 62 0x00, 0x00, 0x07, 0x00, 0x80, 0x76, 0xdf, 0xf8, 0x7f, 0xce, 0x00, 0x00, 0x19, 0x7d, 0xb4, 0x00, 63 0x00, 0x00, 0x06, 0x00, 0x80, 0xfe, 0xbf, 0xfc, 0x37, 0x88, 0x00, 0x06, 0x5b, 0x7c, 0x00, 0x1e, 64 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x20, 0x60, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x14, 65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 66 0x00, 0x00, 0x00, 0x00, 0xc6, 0x49, 0x66, 0x8c, 0x26, 0x59, 0xb6, 0x20, 0x00, 0x40, 0x00, 0x00, 67 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 68 0x00, 0x01, 0xe0, 0x18, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 69 0x00, 0x01, 0xc0, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 73};
Comments
Only logged in users can leave comments
dart91
0 Followers
•0 Projects
0