Upcoming shows/vending:

 

 

 

 

 

 Know of a show I should go to? Tell me!

Arduino Wi-Fi Clocks

Scrolling marquee wifi clock. Uses ESP8266 and a few 8x8 matrix modules. Pay attention to the libraries needed for these sketches. 

 

 

/*******************************************************************
    ESP8266 WiFi Clock on a series of 8x8 LED matrixs (marquee)   Nov 25, 2020
    Compiled on Arduino IDE 1.8.10
    Relies heavily on the library EZtime https://github.com/ropg/ezTime
    Connects to your Wi-Fi (also prints out the MAC address of the ESP8266 to serial Monitor and hardware display) 
    then sends an NTP request to pool.ntp.org to get the date and time. FYI: a lot of helper text is outputed through the Serial Monitor.

   * The core of this program can also web (HTML) scrape. Could be a clock that also gives you the word of the day!!?!? what a great idea.  
   * You could also scrape weather data too, but every weather website I try to scape has a layout that is very complex. API is way to go....
   * I might make a version2 that is a word clock. So 9:45 PM  would output the words "Nine fourty five PM". Sounds fun. 

    Tested and working for: 
    ESP8266 Wemos (or clone) D1 Mini
    LOLIN(WEMOS)D1 R2 & Mini
    
    
    Parts:
    D1 Mini ESP8266
    MAX7219 LED Display Dot led Matrix (Qty 6-10)

    (c) Ryan Bates 2020
    Main site: www.RetroBuiltGames.com
    Youtube: http://www.youtube.com/c/RyanBatesRBG
    Twitter: https://twitter.com/RetroBuiltGames @RetroBuiltGames
    Tindie:  https://www.tindie.com/stores/ryanbatesrbg/
    
    
 *******************************************************************/


 //global variables
 #define PRINTS(x)
char MAC_AddressData[32] = {0};
char IP_AddressData[32] = {0}; 
char dateData[32] = {0};                  // 128 character size buffer to store our data.
char dateString[] = {0};                  // buffer for storing the Date month,day,year 
char currentTimeData[16] = {0};           //buffer for storing the HH:MM
char currentEverythingData[128] = {0};    // buffer for storing the DATE, TIME, and Day of Week all together (so it scrolls uniformly) 
// you will cripple things if your buffer is too small and you force more data than what it can fit.
// I managed to put my esp8266 into an infintied reset loop somehow, pretty sure this was the case? 

int analogPin  = A0 ; //used for the text scroll speed/ optinal hardware 
int scrollSpeed = 0;
// ----------------------------
// Standard Libraries
// ----------------------------

//ESP8266 libriaries
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>

//FC_16 LED Matrix libriaries
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>


//Setup for the 8x8 matrix type. Depending on what matrix hardware you purchase, this might change.
// Options: PAROLA_HW, GENERIC_HW, ICSTATION_HW, FC16_HW
// Details here: https://majicdesigns.github.io/MD_MAX72XX/page_hardware.html

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW //change this if you have different 8x8 matrix hardware, see link above
#define MAX_DEVICES 8 //number of 8x8 modules connected in series
#define CLK_PIN   D5 // or SCK
#define DATA_PIN  D7 // or MOSI
#define CS_PIN    D8 // or SS

// SPI hardware interface, using both libraries, objects needed for both MAX72xx and Parola
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);


// We always wait a bit between updates of the display
#define  DELAYTIME  20  // in milliseconds




//------- Replace the following with you WIFI credentials ------
char ssid[] = "xxxxxx";       // your network SSID (name)
char password[] = "xxxxxxx";                   // your network key / password

// For Non-HTTPS requests
// WiFiClient client;

// For HTTPS requests
WiFiClientSecure client;


//--------setup for EZ Time. optional------------
#include <ezTime.h>
#define MYTIMEZONE "America/New_York"
Timezone myTZ;


  
void setup() {
 mx.begin(); //initialize display for MAX72xx library
 mx.control(MD_MAX72XX::INTENSITY, 8);    // brightness of the display, Range is 1-8  
 scrollSpeed = 30;                        //set the speed slow for web connection status info 
  spiral();                               //display effects just for show on startup.
  stripe(); 


 Serial.begin(115200);
 //-------print hardware MAC address of ESP-------------
  Serial.print("MAC: ");                  //print hardware MAC address of ESP
  Serial.println(WiFi.macAddress());
  String MAC_AddressString = "";
  MAC_AddressString = "MAC: " +  WiFi.macAddress();
  MAC_AddressString.toCharArray(MAC_AddressData,sizeof(MAC_AddressData));
 
  scrollText(MAC_AddressData);
  
  delay(2000);


  //=============== Connect to the WiFI  ==============================================
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);

  // Attempt to connect to Wifi network:
  Serial.print("Connecting WiFi: ");  
  Serial.println(ssid);       
  scrollText("Connecting to WiFi:  "); 
  scrollText(ssid);       
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    scrollText("Connecting...");       
    delay(500);
  }
  Serial.println("");
  Serial.println("WiFi connected");
  scrollText("Connected!      ");  
  Serial.print("IP address: ");
  String IP_AddressString = "";
  IP_AddressString.toCharArray(IP_AddressData,sizeof(IP_AddressData)); 
  scrollText(IP_AddressData);
  IPAddress ip = WiFi.localIP();
  Serial.println(ip);
  Serial.println();
 


  
///===============Get time for EZ Time.  ==============================
scrollText("(getting time)");
  setDebug(INFO); waitForSync();  //grabs time from NTP server 
  setInterval(43200);           // Set NTP polling interval to 12 hrs  (12*60*60 seconds) 
  Serial.println();
  Serial.println("UTC:             " + UTC.dateTime());
 
  myTZ.setLocation(F(MYTIMEZONE));
  //myTZ.setTime(compileTime());     // grabs time at time on compile. good for testing so you dont annoy the NTP server
  Serial.print(F("Time in your set timezone:         "));
   
  Serial.println(myTZ.dateTime());

  // We don't need to check the fingerprint
  client.setInsecure();
}



void loop() {
  
  textScrollSpeed();

    unsigned long now = millis();

//======== Get the DATE FORMAT| Day of Week, Month, Day, Year==================    
String dateString = "";
dateString = myTZ.dateTime("D M j, Y");
dateString.toCharArray(dateData,sizeof(dateData));


//======== Get TIME OF DAY===============
String hourString = "";
  hourString = myTZ.dateTime("g"); //string to pull the hours from ezTime

String minuteString = "";
  minuteString = myTZ.dateTime("i"); //string to pull the minutes from ezTime

String AMPMstring = "";
AMPMstring = (myTZ.dateTime("A")); 

String currentTimeString = "";
currentTimeString = hourString + ":" + minuteString + "  "  +  AMPMstring;
currentTimeString.toCharArray(currentTimeData, sizeof(currentTimeData));

//====Combine all the strings and convert to a Char arrary for the scrollText() function. 
String currentEverythingString = "";
currentEverythingString = dateString + "      " + hourString + ":" + minuteString + "  "  +  AMPMstring + "   ";
currentEverythingString.toCharArray(currentEverythingData, sizeof(currentEverythingData));


//======== Print to Marquee================
scrollText(currentEverythingData); // print to LED matrix marquee;
// note to self and everyone: this MD_MAX72XX LED matrix ScrollText commands only works with Char arrays, not texts despite the contect of the command.
//You can only print data that is a Character Array. It's a bit dumb; but, whatever. 
//I think the scrollNumber is ok with integers? ...No, it's not. 
 delay(15000); //pause on the time, before looping again with the date

}



void textScrollSpeed(){ //Use some hardware (a potentiomertor) to set the scroll speed at the marquee.
//scrollSpeed = analogRead(analogPin);
  scrollSpeed = 30;
//scrollSpeed = map(scrollSpeed,0,1023, 5,40); 
}



//======================== Start of Marquee animations and effects ============== at minimum you need the scrollText() function======
// from MD_MAX72XX library; example "MD_MAX72xx_TEST"
void scrollText(char *p) 
{
  uint8_t charWidth;
  uint8_t cBuf[8];  // this should be ok for all built-in fonts
  mx.clear();
  
  while (*p != '\0') {
    charWidth = mx.getChar(*p++, sizeof(cBuf) / sizeof(cBuf[0]), cBuf);
    for (uint8_t i=0; i<=charWidth; i++)  // allow space between characters
    {mx.transform(MD_MAX72XX::TSL);
      if (i < charWidth)
        mx.setColumn(0, cBuf[i]);
      delay(scrollSpeed);
    }
  }
}


void spiral()
// setPoint() used to draw a spiral across the whole display
{
  int  rmin = 0, rmax = ROW_SIZE-1;
  int  cmin = 0, cmax = (COL_SIZE*MAX_DEVICES)-1;
  mx.clear();
  while ((rmax > rmin) && (cmax > cmin))
  {
    // do row
    for (int i=cmin; i<=cmax; i++)
    {mx.setPoint(rmin, i, true);
      delay(DELAYTIME/MAX_DEVICES);
    }
    rmin++;

    // do column
    for (uint8_t i=rmin; i<=rmax; i++)
    {mx.setPoint(i, cmax, true);
      delay(DELAYTIME/MAX_DEVICES);
    }
    cmax--;

    // do row
    for (int i=cmax; i>=cmin; i--)
    {mx.setPoint(rmax, i, true);
      delay(DELAYTIME/MAX_DEVICES);
    }
    rmax--;

    // do column
    for (uint8_t i=rmax; i>=rmin; i--)
    {mx.setPoint(i, cmin, true);
      delay(DELAYTIME/MAX_DEVICES);
    }
    cmin++;
  }
}

void stripe()
// Demonstrates animation of a diagonal stripe moving across the display
// with points plotted outside the display region ignored.
{
  const uint16_t maxCol = MAX_DEVICES*ROW_SIZE;
  const uint8_t  stripeWidth = 10;
  mx.clear();
  for (uint16_t col=0; col<maxCol + ROW_SIZE + stripeWidth; col++)
  {
    for (uint8_t row=0; row < ROW_SIZE; row++)
    {mx.setPoint(row, col-row, true);
      mx.setPoint(row, col-row - stripeWidth, false);
    }
    delay(DELAYTIME);
  }
   mx.update();
}

4x20 [character] LCD wifi Clock. Uses ESP8266 and i2c 4x20 LCD display.  Pay attention to the libraries needed for these sketches. 

 

 

 

/*******************************************************************
    ESP8266 WiFi Clock with large format numbers on 4x20LCD     Nov 25, 2020
    Compiled on Arduino IDE 1.8.10

    Relies heavily on the library EZtime https://github.com/ropg/ezTime
    Connects to your Wi-Fi (also prints out the MAC address of the ESP8266 to serial Monitor and hardware display) 
    then sends an NTP request to pool.ntp.org to get the date and time. 

    Tested and working for: 
    ESP8266 Wemos (or clone) D1 Mini
    
    Parts:
    D1 R2 or Mini ESP8266
    4x20LCD with i2c shield

    Optional: (for auto LCD backight dimming)
    PhotoResistor
    10K resistor
    some kind of transistor to handle the backlight LEDs

    (c) Ryan Bates 2020
    Main site: www.RetroBuiltGames.com
    Youtube: http://www.youtube.com/c/RyanBatesRBG
    Twitter: https://twitter.com/RetroBuiltGames @RetroBuiltGames
    Tindie:  https://www.tindie.com/stores/ryanbatesrbg/
    
 *******************************************************************/

//=========================== arrays to build big font segments======================= If you change these, you can change the font style
byte AA[8] =
{  B11111,  B11111,  B11111,  B11111,  B00000,  B00000,  B00000,  B00000};
byte BB[8] =
{  B00000,  B00000,  B00000,  B00000,  B11111,  B11111,  B11111,  B11111};
byte CC[8] =
{  B00000,  B00000,  B11111,  B11111,  B11111,  B11111,  B00000,  B00000};
byte DD[8] =
{  B11111,  B11111,  B11111,  B11111,  B11111,  B11111,  B00000,  B00000};
byte EE[8] =
{  B00000,  B00000,  B11111,  B11111,  B11111,  B11111,  B11111,  B11111};
byte FF[8] =
{  B11111,  B11111,  B11111,  B11111,  B11111,  B11111,  B11111,  B11111};
byte GG[8] =
{  B00000,  B00000,  B00000,  B00000,  B00000,  B00000,  B00000,  B00000};
byte dot[8] =
{ B00000,   B00000,  B00000,  B00000,  B00000,  B01110,  B01110,  B01110};

int x =0;                           //position for the LCD column
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F,20,4);   // Set the LCD address for a 20 chars (x-pos) and 4 (y-pos) line display
                                    // Your i2C backpack will likely have a different hardware (hex) address.
                                    // you will have to run a i2c sniffer sketch to check for i2c hardware present on the  i2c bus. 
const int LCD_NB_ROWS = 4 ;        
const int LCD_NB_COLUMNS = 20 ;

unsigned long previousMillis = 0;  //used to blink the colon in the HH:MM display without putting delays in the code
const long interval = 1000;

int screenState = LOW;   
int backlightDimmer = D3;         //pin for pwm D5, 
int amibientLight = A0;           // can use a photoresistor to check how dark the room is, and adjust the LCD brightness. 
                                  // this was giving me issues on the EPP8266. I might have given up on it. 


// ----------------------------
// Standard Libraries
// ----------------------------

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>


// We always wait a bit between updates of the display
#define  DELAYTIME  20  // in milliseconds


//------- Replace the following! ------
char ssid[] = "xxxxxxx";       // your network SSID (name)
char password[] = "xxxxxxx";                    // your network key / password

// For Non-HTTPS requests
// WiFiClient client;

// For HTTPS requests
WiFiClientSecure client;


unsigned long requestDue = 0;
int delayBetweenRequests = 500;                     //  (refreshes web scrape every hour)

//--------setup for EZ Time. optional------------
#include <ezTime.h>
#define MYTIMEZONE "America/New_York"
Timezone myTZ;


void setup() {
  pinMode(backlightDimmer,OUTPUT);
  //analogWrite(backlightDimmer,0);     // might need this for ESP8266 bc it's quirky
lcd.init();                             // initialize the 4x20 lcd
lcd.backlight();                        // open the backlight
lcd.begin(LCD_NB_COLUMNS ,LCD_NB_ROWS); // setup the LCD? This i2c library is confusing. 


lcd.setCursor(5,0);  lcd.print("Wi-Fi Clock");
lcd.setCursor(0,1);  lcd.print("(c) 2020 Ryan Bates");
delay(800);

  lcd.createChar(7,AA);                 //make the custom segments (chuncks) for big numbers
  lcd.createChar(1,BB);
  lcd.createChar(2,CC);
  lcd.createChar(3,DD);
  lcd.createChar(4,EE);
  lcd.createChar(5,FF);
  lcd.createChar(6,GG);
  lcd.createChar(8,dot);
  
  Serial.begin(115200);
  lcd.setCursor(0,1);
  Serial.print("MAC: ");                  
  Serial.println(WiFi.macAddress());      //print hardware MAC address of ESP to Serial Monitor
  lcd.setCursor(0,2);
  lcd.print("MAC: "); 
  lcd.setCursor(0,3);
  lcd.print(WiFi.macAddress());            //print hardware MAC address of ESP to LCD
  delay(2000);
  lcd.clear();

  //=============== Connect to the WiFI  ==============================================
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);

  // Attempt to connect to Wifi network:
  Serial.print("Connecting Wifi: ");  
  Serial.println(ssid);               
  WiFi.begin(ssid, password);
  lcd.print("Connecting to Wifi"); lcd.setCursor(0,0);
  lcd.print(ssid);                 lcd.setCursor(0,1);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    lcd.print(".");        
    delay(500);
  }
  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.print("IP address: ");     
  IPAddress ip = WiFi.localIP();               // print the IP address
  Serial.println(ip);
  Serial.println();
  lcd.clear(); lcd.setCursor(0,0);
  lcd.print("CONNECTED!"); lcd.setCursor(0,1);
  lcd.print(ip);
  delay(2000);
  lcd.clear();


  
///===============Get time for EZ Time. optional ==============================
  setDebug(INFO); waitForSync();          //grabs time from NTP server 
  setInterval(43200);                     // Set NTP polling interval to 12 hrs  (12*60*60 seconds) 
  Serial.println();
  Serial.println("UTC:             " + UTC.dateTime());
 
  myTZ.setLocation(F(MYTIMEZONE));
  //myTZ.setTime(compileTime());           // grabs time at time on compile. good for testing so you dont annoy the NTP server
  Serial.print(F("Time in your set timezone:         "));
  
  Serial.println(myTZ.dateTime());

  // We don't need to check the fingerprint
  client.setInsecure();
}



void loop() {
  
unsigned long currentMillis = millis();
 if(currentMillis - previousMillis > interval) {
   previousMillis = currentMillis;        // save the last time of cycle execution 
   if (screenState == LOW) {              // if the LED is off turn it on and vice-versa:
      screenState = HIGH;
      lcd.setCursor(8,0); lcd.write(6);   // blank the colon (:) in big font
      lcd.setCursor(8,2); lcd.write(6); } 
   
   else{
    screenState = LOW;
    lcd.setCursor(8,0); lcd.write(4);      // write the colon (:) in big font
    lcd.setCursor(8,2); lcd.write(3); 
   }}         



    unsigned long now = millis(); //time stamp for the get time routine 
  if(requestDue < now){
    requestDue = now + delayBetweenRequests;
    
  }


String dateString = "";
dateString = myTZ.dateTime("D M j, Y");
lcd.setCursor(18,2); lcd.print(myTZ.dateTime("A"));     // prints the AM or PM text
//lcd.setCursor(0,2); lcd.print(myTZ.dateTime("g:i A")); //string to pick apart to time in big font
lcd.setCursor(0,3); lcd.print(dateString);
Serial.println(myTZ.dateTime("g:i A"));
printBigNumbers();
//delay(500);

//backlightBrightness();      // issues with the ESP8266 hardware, so i dont use this. 

}

void backlightBrightness(){  //this gave me problems with EPS8266's hardware, so i think it's unused. 
  int backlightBrightness =0 ;
  backlightBrightness = analogRead(amibientLight); //Yo! THE ESP HAS A 10-BIT PWM not 8-bit like the ATMEGA328P
  backlightBrightness = map(backlightBrightness, 0, 1023, 1023, 10); //darkness 9, well lit room 92
  analogWrite(backlightDimmer, backlightBrightness);
  Serial.print(backlightBrightness);
  Serial.print("  ");
  Serial.print(backlightDimmer);
  Serial.print("  ");
}

void printBigNumbers() {
String hourString = "";
  hourString = myTZ.dateTime("g");  //string to pull the hours from ezTime
  int hourInt; 
  hourInt = hourString.toInt();     //now it's an integer if you want to do this. dont need to as i found out lcd.print() is pretty chill

String minuteString = "";
  minuteString = myTZ.dateTime("i"); //string to pull the minutes from ezTime
  //int minuteInt = minuteString.toInt(); // covert to an integer?! well you dont have to, because exTime works with the vanilla minutes() and hour() variable.


//=== Minutes  00:0X (ones place) ===========
int tens  [6] = {0,10,20,30,40,50};                                         //build an array with number to check against for building the large format digits
int ones  [6] = {1,11,21,31,41,51}; 
int twos  [6] = {2,12,22,32,42,52};
int threes[6] = {3,13,23,33,43,53};
int fours [6] = {4,14,24,34,44,54};
int fives [6] = {5,15,25,35,45,55};
int sixes [6] = {6,16,26,36,46,56};
int sevens[6] = {7,17,27,37,47,57};
int eights[6] = {8,18,28,38,48,58};
int nines [6] = {9,19,29,39,49,59};
  
for (int i =0; i<6; i++){ if (minute() == tens  [i]) { x=14; big0();      }  } // loop through the array's contents checking for a match.
for (int i =0; i<6; i++){ if (minute() == ones  [i]) { x=14; big1();      }  }
for (int i =0; i<6; i++){ if (minute() == twos  [i]) { x=14; big2();      }  }
for (int i =0; i<6; i++){ if (minute() == threes[i]) { x=14; big3();      }  }
for (int i =0; i<6; i++){ if (minute() == fours [i]) { x=14; big4();      }  }
for (int i =0; i<6; i++){ if (minute() == fives [i]) { x=14; big5();      }  }
for (int i =0; i<6; i++){ if (minute() == sixes [i]) { x=14; big6();      }  }
for (int i =0; i<6; i++){ if (minute() == sevens[i]) { x=14; big7();      }  }
for (int i =0; i<6; i++){ if (minute() == eights[i]) { x=14; big8();      }  }
for (int i =0; i<6; i++){ if (minute() == nines [i]) { x=14; big9();      }  }

//=== Minutes  00:X0 (tens place) ===========
if (minute() < 10 )                   { x = 10; big0();   } //leading zero
if (minute() >= 10 && minute() < 20 ) { x = 10; big1();   }
if (minute() >= 20 && minute() < 30 ) { x = 10; big2();   }
if (minute() >= 30 && minute() < 40 ) { x = 10; big3();   }
if (minute() >= 40 && minute() < 50 ) { x = 10; big4();   }
if (minute() >= 50 && minute() < 60 ) { x = 10; big5();   }

//=== Hours 0X:00 (ones place) =====

if  (hourInt == 0 || hourInt == 10 ){ x=4; big0();     }
if  (hourInt == 1 || hourInt == 11 ){ x=4; big1();     }
if  (hourInt == 2 || hourInt == 12 ){ x=4; big2();     }
if  (hourInt == 3 ){  x=4; big3();    }
if  (hourInt == 4 ){  x=4; big4();    }
if  (hourInt == 5 ){  x=4; big5();    }
if  (hourInt == 6 ){  x=4; big6();    }
if  (hourInt == 7 ){  x=4; big7();    }
if  (hourInt == 8 ){  x=4; big8();    }
if  (hourInt == 9 ){  x=4; big9();    }
if  (hourInt == 10){  x=4; big0();    }
if  (hourInt == 11){  x=4; big1();    }
if  (hourInt == 12){  x=4; big2();    }

//=== Hours 0X:00 (ones place) =====
if  (hourInt >= 10){  x=0; big1();  }
if  (hourInt == 10 ){ x=0; big1();  }
  
  if (hourInt < 10)                             // Leading blank for hours below 10, because we dont have a leading zero in the hour (tens) column
                                                // this is so weird to me when you have to program it in. 
                                                // We dont read time with leading zeroes for the hour's place; Say 9PM; it's not 09:00 PM, it's 9:00 PM. 
                                                // BUT we do for minutes. 9:06 PM is not 9:_6 PM, so we need leading zeros for MM. uhg
  { x=0; lcd.setCursor(x, 0);    lcd.print("   ");
         lcd.setCursor(x, 1);    lcd.print("   ");
         lcd.setCursor(x, 2);    lcd.print("   "); }
  }

 //==============================section for assembling the large font numbers==================
// There are many ways to build the large number segments on this 4x20LCD,
// I've left a few examples. Some show an inexperience coder (me in 2012). 
// Then some later examples show a few tricks I figured out. I've left the different examples
// because it's a good way to digest and learn some tricks. 
// Note: big= 3x3 size number; huge= 4x4 size number

//Make the 3x3 'big' Zero numeric
void big0() //this is the simplest way to build the big numbers (height of number is 3 lines)
{ 
  lcd.setCursor(x, 0);  // set cursor to [character-place 0, line 0]. (first row)
  lcd.write(5);         // call each segment to create
  lcd.write(7);         // top section
  lcd.write(5);
  lcd.setCursor(x, 1);  // set cursor to [character-place-place 0, line 1]. (second row)
  lcd.write(5);         // call each segment to create
  lcd.write(6);         // middle section
  lcd.write(5);
  lcd.setCursor(x, 2);  //set cursor to [character-place-place 0, line 2].
  lcd.write(5);         // call each segment to create
  lcd.write(1);         // middle section
  lcd.write(5);         // bottom section
}

void big1(){
  lcd.setCursor(x, 0); lcd.write(7);  lcd.write(5);  lcd.write(6);
  lcd.setCursor(x, 1); lcd.write(6);  lcd.write(5);  lcd.write(6);
  lcd.setCursor(x, 2); lcd.write(1);  lcd.write(5);  lcd.write(1);    }

void big2(){
  lcd.setCursor(x, 0); lcd.write(7);  lcd.write(7);  lcd.write(5);
  lcd.setCursor(x, 1); lcd.write(4);  lcd.write(2);  lcd.write(3);
  lcd.setCursor(x, 2); lcd.write(5);  lcd.write(1);  lcd.write(1);    }

void big3(){
  lcd.setCursor(x, 0); lcd.write(7);  lcd.write(7);  lcd.write(5);
  lcd.setCursor(x, 1); lcd.write(2);  lcd.write(2);  lcd.write(5);
  lcd.setCursor(x, 2); lcd.write(1);  lcd.write(1);  lcd.write(5);    }

void big4(){
  lcd.setCursor(x, 0); lcd.write(5);  lcd.write(6);  lcd.write(5);
  lcd.setCursor(x, 1); lcd.write(3);  lcd.write(2);  lcd.write(5);
  lcd.setCursor(x, 2); lcd.write(6);  lcd.write(6);  lcd.write(5);    }

void big5(){
  lcd.setCursor(x, 0);  lcd.write(5);  lcd.write(7);  lcd.write(7);
  lcd.setCursor(x, 1);  lcd.write(3);  lcd.write(2);  lcd.write(4);
  lcd.setCursor(x, 2);  lcd.write(1);  lcd.write(1);  lcd.write(5);    }

void big6(){
  lcd.setCursor(x, 0); lcd.write(5);  lcd.write(6);  lcd.write(6);
  lcd.setCursor(x, 1); lcd.write(5);  lcd.write(2);  lcd.write(4);
  lcd.setCursor(x, 2); lcd.write(5);  lcd.write(1);  lcd.write(5);    }

void big7(){
  lcd.setCursor(x, 0); lcd.write(7);  lcd.write(7);  lcd.write(5);
  lcd.setCursor(x, 1); lcd.write(6);  lcd.write(6);  lcd.write(5);
  lcd.setCursor(x, 2); lcd.write(6);  lcd.write(6);  lcd.write(5);    }

void big8(){
  lcd.setCursor(x, 0); lcd.write(5);  lcd.write(7);  lcd.write(5);
  lcd.setCursor(x, 1); lcd.write(5);  lcd.write(2);  lcd.write(5);
  lcd.setCursor(x, 2); lcd.write(5);  lcd.write(1);  lcd.write(5);    }

void big9(){
  lcd.setCursor(x, 0); lcd.write(5);  lcd.write(7);  lcd.write(5);
  lcd.setCursor(x, 1); lcd.write(3);  lcd.write(2);  lcd.write(5);
  lcd.setCursor(x, 2); lcd.write(6);  lcd.write(6);  lcd.write(5);    }
  
void huge0(){
  lcd.setCursor(x, 0); lcd.write(5);  lcd.write(7);  lcd.write(7);  lcd.write(5);
  lcd.setCursor(x, 1); lcd.write(5);  lcd.write(6);  lcd.write(6);  lcd.write(5);
  lcd.setCursor(x, 2); lcd.write(5);  lcd.write(6);  lcd.write(6);  lcd.write(5);
  lcd.setCursor(x, 3); lcd.write(5);  lcd.write(1);  lcd.write(1);  lcd.write(5); }
  
void huge1(){
  lcd.setCursor(x, 0); lcd.write(6);  lcd.write(1);  lcd.write(5);  lcd.write(6);
  lcd.setCursor(x, 1); lcd.write(6);  lcd.write(6);  lcd.write(5);  lcd.write(6);
  lcd.setCursor(x, 2); lcd.write(6);  lcd.write(6);  lcd.write(5);  lcd.write(6);
  lcd.setCursor(x, 3); lcd.write(6);  lcd.write(1);  lcd.write(5);  lcd.write(1); }
void huge2(){
  lcd.setCursor(x, 0); lcd.write(7);  lcd.write(7);  lcd.write(7);  lcd.write(5);
  lcd.setCursor(x, 1); lcd.write(1);  lcd.write(1);  lcd.write(1);  lcd.write(5);
  lcd.setCursor(x, 2); lcd.write(5);  lcd.write(6);  lcd.write(6);  lcd.write(6);
  lcd.setCursor(x, 3); lcd.write(5);  lcd.write(1);  lcd.write(1);  lcd.write(1); }
  
  void huge3(){
  lcd.setCursor(x, 0); lcd.write(7);  lcd.write(7);  lcd.write(7);  lcd.write(5);
  lcd.setCursor(x, 1); lcd.write(1);  lcd.write(1);  lcd.write(1);  lcd.write(5);
  lcd.setCursor(x, 2); lcd.write(6);  lcd.write(6);  lcd.write(6);  lcd.write(5);
  lcd.setCursor(x, 3); lcd.write(1);  lcd.write(1);  lcd.write(1);  lcd.write(5); }
  
  void huge4(){ //another way to build the numbers
  int row0[4]= {5,6,6,5};  lcd.setCursor(x, 0);for (int i =0; i<4; i++){  lcd.write(row0[i]);}
  int row1[4]= {5,1,1,5};  lcd.setCursor(x, 1);for (int i =0; i<4; i++){  lcd.write(row1[i]);} 
  int row2[4]= {6,6,6,5};  lcd.setCursor(x, 2);for (int i =0; i<4; i++){  lcd.write(row2[i]);} 
  int row3[4]= {6,6,6,5};  lcd.setCursor(x, 3);for (int i =0; i<4; i++){  lcd.write(row3[i]);} }  

  void huge5(){ // yet another way to build the numbers// i like this the most; can be improved w/ more math
  int row[16]= {5,7,7,7,5,1,1,1,6,6,6,5,1,1,1,5};
  lcd.setCursor(x, 0);for (int i = 0; i< 4; i++){  lcd.write(row[i]);}
  lcd.setCursor(x, 1);for (int i = 4; i< 8; i++){  lcd.write(row[i]);}
  lcd.setCursor(x, 2);for (int i = 8; i<12; i++){  lcd.write(row[i]);}
  lcd.setCursor(x, 3);for (int i =12; i<16; i++){  lcd.write(row[i]);} }

  void huge6(){ //this section is in the youtube video
  int row[16]= {5,6,6,6,5,6,6,6,5,7,7,5,5,1,1,5};  
  lcd.setCursor(x, 0);for (int i = 0; i< 4; i++){  lcd.write(row[i]);}
  lcd.setCursor(x, 1);for (int i = 4; i< 8; i++){  lcd.write(row[i]);}
  lcd.setCursor(x, 2);for (int i = 8; i<12; i++){  lcd.write(row[i]);}
  lcd.setCursor(x, 3);for (int i =12; i<16; i++){  lcd.write(row[i]);} }

  void huge7(){ //keeping this style, its easier to decifer
  int row0[4]= {7,7,7,5};  lcd.setCursor(x, 0);for (int i =0; i<4; i++){  lcd.write(row0[i]);}  
  int row1[4]= {6,6,6,5};  lcd.setCursor(x, 1);for (int i =0; i<4; i++){  lcd.write(row1[i]);} 
  int row2[4]= {6,6,6,5};  lcd.setCursor(x, 2);for (int i =0; i<4; i++){  lcd.write(row2[i]);} 
  int row3[4]= {6,6,6,5};  lcd.setCursor(x, 3);for (int i =0; i<4; i++){  lcd.write(row3[i]);} }

  void huge8(){
  int row0[4]= {5,7,7,5};  lcd.setCursor(x, 0);for (int i =0; i<4; i++){  lcd.write(row0[i]);}  
  int row1[4]= {5,1,1,5};  lcd.setCursor(x, 1);for (int i =0; i<4; i++){  lcd.write(row1[i]);} 
  int row2[4]= {5,6,6,5};  lcd.setCursor(x, 2);for (int i =0; i<4; i++){  lcd.write(row2[i]);} 
  int row3[4]= {5,1,1,5};  lcd.setCursor(x, 3);for (int i =0; i<4; i++){  lcd.write(row3[i]);} }

  void huge9(){
  int row0[4]= {5,7,7,5};  lcd.setCursor(x, 0);for (int i =0; i<4; i++){  lcd.write(row0[i]);}  
  int row1[4]= {5,1,1,5};  lcd.setCursor(x, 1);for (int i =0; i<4; i++){  lcd.write(row1[i]);}
  int row2[4]= {6,6,6,5};  lcd.setCursor(x, 2);for (int i =0; i<4; i++){  lcd.write(row2[i]);} 
  int row3[4]= {6,6,6,5};  lcd.setCursor(x, 3);for (int i =0; i<4; i++){  lcd.write(row3[i]);} }

Print | Sitemap
© 2013-2023 Ryan Bates and © 2013-2023 Retro Built Games, LLC. All photos, designs, documents, and graphics (C) Ryan Bates. All Rights Reserved.

This site is best viewed on a desktop PC. Raspberry Pi is a trademark of the Raspberry Pi Foundation. ARDUINO® and other Arduino brands and logos published in the website are Trademarks of Arduino AG.