How to make a nice retro look word clock. Word clock, because current time is presented in the form of text instead of numbers.

This time I will show you how to make a nice retro look word clock, made of such a Display. Word clock, because current time is presented in the form of text instead of numbers. Of course, there is also a mode in which time and date are presented in standard form.

This video is sponsored by PCBgogo: https://www.pcbgogo.com/thanks2021.htm

As the title suggests, to make the device is used an unknown VFD serial display, which previously was used as a POS customer display. In one of my previous videos I explained how to connect almost any serial VFD display to Arduino:

This time I will present you another, simpler way to connect a VFD display to Arduino. According to the markings on the chips, we will first find out which of them is a microcontroller. In this case, it is a Winbond W78C32C-40 microcontroller. Now in Datasheet, we are looking for which of the pins of the microcontroller is Rx. As we can see, in our case it is pin 10. At this pin, we bring directly the signal from the Arduino microcontroller and that's it. Of course, we need also to connect the power supply as described in the video above.

As you can see, only three components are needed to make this device:

- VFD Display taken from old POS Display

- Arduino Nano microcontroller

- and DS3231 Real-time clock module

- it also has two mini switches, one for power and one for standard clock mode

The Arduino and Real-Time clock board are mounted (glued) directly to the display PCB using double-sided adhesive. This avoids making a box and enables this minimalistic design. The display holder is made entirely of Plexiglas.

First, we need to set the exact time on the Realtime clock module, and that is the simplest to do through the examples in the DS1307 Library. We need to upload this code in Arduino and so the time is automatically adjusted (synchronized) with the time from PC. After that, we upload the code in Arduino, and the device is ready. The exact time is indicated by words. Refresh is done every minute.

As I said before, there is also a mode in which time and date are presented in standard form. We Can enable this mod by a second small switch. I am from Macedonia and my native language is Macedonian, so I also made a code where the Time is displayed in Macedonian with Cyrillic alphabet.

Schematic Final.jpg
        #include <RTClib.h> 
#include <SoftwareSerial.h>
#include <Wire.h>
RTC_DS1307 RTC;

// Массив со словами 
char* myNumeral[]={"\132\105\122\117",  // ноль - 0  (zero)
"\117\116\105",  //одна - 1  (one)  
"\124\127\117", //две - 2  (two)
"\124\110\122\105\105",  //три - 3 (three)  
"\106\117\125\122",  //четыре - 4  (four)
"\106\111\126\105",  //пять - 5 (five)
"\123\111\130", //шесть - 6  (six)
"\123\105\126\105\116",  //семь - 7 (seven)
"\105\111\107\110\124", //восемь - 8 (eight)
"\116\111\116\105", //девять - 9 (nine)
"\124\105\116", // десять - 10  (ten)
"\105\114\105\126\105\116",  //одиннадцать - 11 (eleven)
"\124\127\105\114\126\105", // двенадцать - 12  (twelve)
"\124\110\111\122\124\105\105\116", //тринадцать - 13 (thirteen)
"\106\117\125\122\124\105\105\116", //четырнадцать - 14 (fourteen)
"\106\111\106\124\105\105\116",  // пятнадцать - 15 (fifteen)
"\123\111\130\124\105\105\116", //шестнадцать - 16 (sixteen)
"\123\105\126\105\116\124\105\105\116", // семнадцать - 17 (seventeen)
"\105\111\107\110\124\105\105\116", //восемнадцать - 18 (eighteen)
"\116\111\116\105\124\105\105\116", //девятнадцать - 19 (nineteen)
"\124\127\105\116\124\131", // двадцать - 20 (twenty)
"\124\110\111\122\124\131", // тридцать - 21 (thirty)
"\106\117\122\124\131", //сорок - 22 (forty)
"\106\111\106\124\131", //пятьдесят - 23 (fifty)

"\117\116\105", // один - 24 (one)
"\124\127\117", // два - 25 (two)

"\117\140\103\114\117\103\113", // часов - 26 (0'CLOCK)
"\227\200\221", // час - 27
"\227\200\221\200", // часа - 28

"\214\210\215\223\222", // минут - 29
"\214\210\215\223\222\200", // минута - 30
"\115\111\116\125\124\105\123", // минуты - 31 (minutes)
"\115\111\116", // мин - 32 (min)
"\115\117\116\104\101\131", // понедельник - 33 (monday)
"\124\125\105\123\104\101\131",  // вторник - 34 (tuesday)
"\127\105\104\116\105\123\104\101\131",  // среда - 35 (wednesday)
"\124\110\125\122\123\104\101\131",  // четверг - 36 (thursday)
"\106\122\111\104\101\131",  //пятница - 37 (friday)
"\123\101\124\125\122\104\101\131",  // суббота - 38 (saturday)
"\123\125\116\104\101\131",  // воскресенье - 39 (sunday)
"\112\101\116", // января - 40 (jan)
"\106\105\102", // февраля - 41 (feb)
"\115\101\122", // марта - 42 (mar)
"\101\120\122", // апреля - 43 (apr)
"\115\101\131", // мая - 44 (may)
"\112\125\116", // июня - 45 (jun)
"\112\125\114", // июля - 46 (jul)
"\101\125\107", // августа - 47 (aug)
"\123\105\120", // сентября - 48 (sep)
"\117\103\124", // октября - 49(oct)
"\116\117\126", // ноября - 50 (nov)
"\104\105\103", // декабря - 51 (dec)
"\131\105\101\122" // год - 52 (year)

};


String stringOne, stringTwo, stringThree, stringFour, stringFive, stringSix, stringHour, stringMin,
        stringHourd,stringHourdd, stringMind,stringMindd, stringSecd, stringSecdd, stringPerd,
        stringDaty, stringVtor, stringdday,stringDatyd, stringddayy, stringdmonth, stringdmonthh, stringGod, stringGodn;  // эту фигню объявил для сборки времени словами из массива

SoftwareSerial mySerial(11, 10); // RX, TX

const int buttonPin = 2; // на второй вывод повесил кнопку выбора варианта отображения времени
const int buttonChplus = 3; // на третий вывод повесил кнопку коррентировки час+
const int buttonChminus = 4; // на четвертый вывод повесил кнопку коррентировки час-
const int buttonMinplus = 5; // на пятый вывод повесил кнопку коррентировки минуты+
const int buttonMinminus = 6; // на шестой вывод повесил кнопку коррентировки минуты-
const int buttonSeknol = 7; // на седьмой вывод повесил кнопку коррентировки секунды в ноль
const int buttonDispleysbros = 8; // на восьмой вывод повесил кнопку сброса дисплея
const int buttonCorrHour = 12; // на двенадцатом выводе переключатель корректировки час минута секунда
const int buttonCorrDay = 9; // на двенадцатом выводе переключатель корректировки дней месяца года

int den, mec, god, dday,agod,ygod,mgod; // для вычисления дня недели
int yar, mesyac, denec, chas, minuta, sekunda; // для коррентировки
int korrektwrem;   // коррекция ошибки часов реального времени
void setup()  
{
  // Инициализируем последовательный интерфейс и ждем открытия порта:
  Serial.begin(9600);
  while (!Serial) 
  {
    ; // ожидаем подключения к последовательному порту. Необходимо только для Leonardo  
  }
  
  Serial.println("Goodnight moon!");
    mySerial.begin(9600);

{
Serial.begin(57600);
Wire.begin();
RTC.begin();

      mySerial.write(0x1B); //_________________________Первый уровень яркости
      mySerial.write(0x2A);
      mySerial.write(0x01);

//RTC.adjust(DateTime(2018, 2, 5, 19, 16, 0));  // задаём год/ месяц/ дата/ часы/ минуты/ секунды
}

{
  pinMode(buttonPin, INPUT_PULLUP);  //  вывод этот объявим входом для варианта отображения впемени
  pinMode(buttonChplus, INPUT_PULLUP);  //  и этот вывод объявим входом для корректироки час +
  pinMode(buttonChminus, INPUT_PULLUP);  //  и этот вывод объявим входом для корректировки час -
  pinMode(buttonMinplus, INPUT_PULLUP);  //  и этот вывод объявим входом для корректировки минута +
  pinMode(buttonMinminus, INPUT_PULLUP);  //  и этот вывод объявим входом для корректировки минута -
  pinMode(buttonSeknol, INPUT_PULLUP);  //  и этот вывод объявим входом для корректировки секунда в 0
  pinMode(buttonDispleysbros, INPUT_PULLUP);  //  и этот вывод объявим входом для сброса дисплея
  pinMode(buttonCorrHour, INPUT_PULLUP);  //  и этот вывод объявим входом для полодения тумблера коррекция времени часминсек
  pinMode(buttonCorrDay, INPUT_PULLUP);  //  и этот вывод объявим входом для полодения тумблера коррекция времени деньмесяцгод

}

}
 void loop() // run over and over
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());


 // mySerial.print("\f"); // для тестирования
    
  DateTime now = RTC.now();

  
{
   yar = now.year();       // присваиваем переменным значения года
   mesyac = now.month();   // месяца
   denec = now.day();      // дня
   chas = now.hour();      // часа
   minuta = now.minute();  // минуты
   sekunda = now.second(); // и секунды
   
}

      int buttonStatehour = digitalRead(buttonCorrHour); // считываем состояние тумблера корректировки часминсек
      if (buttonStatehour == LOW)    // если низкая, корректируем время часминсек

       {int buttonStatehp = digitalRead(buttonChplus); //настройка времени кнопками    + час
       if (buttonStatehp == LOW){
       chas = chas + 1;
       RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));
       delay(50);
       }

       int buttonStatehm = digitalRead(buttonChminus); //настройка времени кнопками    - час
       if (buttonStatehm == LOW){
       chas = chas - 1;
       RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));
       delay(50);
       }

       int buttonStatemp = digitalRead(buttonMinplus); //настройка времени кнопками    + минуты
       if (buttonStatemp == LOW){
       minuta = minuta + 1;
       RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));
       delay(50);
       }

       int buttonStatemm = digitalRead(buttonMinminus); //настройка времени кнопками    - минуты
       if (buttonStatemm == LOW){
       minuta = minuta - 1;
       RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));
       delay(50);
       }

       int buttonStatesn = digitalRead(buttonSeknol); //настройка времени кнопками    секунда в ноль
       if (buttonStatesn == LOW){
       sekunda = 0;
       RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));
       delay(50);
       }

       int buttonStateds = digitalRead(buttonDispleysbros); //сбросить дисплей
       if (buttonStateds == LOW){
       mySerial.print("\f");
       delay(50);
       }
       }



       

      int buttonStateday = digitalRead(buttonCorrDay); // считываем состояние тумблера корректировки деньмесяцгод
      if (buttonStateday == LOW)    // если низкая, можно корректировать время деньмесяцгод

       {
       int buttonStatehp = digitalRead(buttonChplus); //настройка времени кнопками    + год
       if (buttonStatehp == LOW){
       yar = yar + 1;
       RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));
       delay(50);
       }

       int buttonStatehm = digitalRead(buttonChminus); //настройка времени кнопками    - год
       if (buttonStatehm == LOW){
       yar = yar - 1;
       RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));
       delay(50);
       }

       int buttonStatemp = digitalRead(buttonMinplus); //настройка времени кнопками    + день
       if (buttonStatemp == LOW){
       denec = denec + 1;
       RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));
       delay(50);
       }

       int buttonStatemm = digitalRead(buttonMinminus); //настройка времени кнопками    - день
       if (buttonStatemm == LOW){
       denec = denec - 1;
       RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));
       delay(50);
       }

       int buttonStatesn = digitalRead(buttonSeknol); //настройка времени кнопками    + месяц
       if (buttonStatesn == LOW){
       mesyac = mesyac + 1;
       RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));
       delay(50);
       }

       int buttonStateds = digitalRead(buttonDispleysbros); //сбросить дисплей
       if (buttonStateds == LOW){
       mySerial.print("\f");
       delay(50);
       }
       
       }





       

         if (chas == 19 && minuta == 03 && sekunda == 30 && korrektwrem == 0 )   //  корректировка часов реального времени 
         { 
           sekunda = sekunda - 7; korrektwrem = korrektwrem + 1 ;RTC.adjust(DateTime(yar, mesyac, denec, chas, minuta, sekunda));  // на 7 секунд
             };

        if (chas == 19 && minuta == 03 && sekunda == 59 )
        {
           korrektwrem = 0; 
             }


  

  int buttonState = digitalRead(buttonPin); // считываем состояние кнопки
  if (buttonState == HIGH) {   // если высокая, время словами - иначе вся информация

  switch (now.hour()) {   //собираем первую строку

       case 0:  stringOne =  myNumeral[0]; stringThree =  myNumeral[26]; stringHour = "     " + stringOne + " " + stringThree + "   "; break;
       case 1:  stringOne =  myNumeral[24]; stringThree =  myNumeral[26]; stringHour = "      " + stringOne + " " + stringThree + "   ";break;
       case 3:  stringOne =  myNumeral[3]; stringThree =  myNumeral[28]; stringHour = "    " + stringOne + " " + stringThree + "   ";break;
       case 4:  stringOne =  myNumeral[4]; stringThree =  myNumeral[28]; stringHour = "    " + stringOne + " " + stringThree + "    ";break;
       case 5:  stringOne =  myNumeral[5]; stringThree =  myNumeral[26]; stringHour = "    " + stringOne + " " + stringThree + "    ";break;
       case 6:  stringOne =  myNumeral[6]; stringThree =  myNumeral[26]; stringHour = "    " + stringOne + " " + stringThree + "     ";break;
       case 7:  stringOne =  myNumeral[7]; stringThree =  myNumeral[26]; stringHour = "    " + stringOne + " " + stringThree + "   ";break;
       case 8:  stringOne =  myNumeral[8]; stringThree =  myNumeral[26]; stringHour = "    " + stringOne + " " + stringThree + "   ";break;
       case 9:  stringOne =  myNumeral[9]; stringThree =  myNumeral[26]; stringHour = "    " + stringOne + " " + stringThree + "    ";break;
       case 10:  stringOne =  myNumeral[10]; stringThree =  myNumeral[26]; stringHour = "     " + stringOne + " " + stringThree + "    ";break;
       case 11:  stringOne =  myNumeral[11]; stringThree =  myNumeral[26]; stringHour = "   " + stringOne + " " + stringThree + "   ";break;
       case 12:  stringOne =  myNumeral[12]; stringThree =  myNumeral[26]; stringHour = "   " + stringOne + " " + stringThree + "   ";break; 
       case 13:  stringOne =  myNumeral[13]; stringThree =  myNumeral[26]; stringHour = "  " + stringOne + " " + stringThree + "  ";break;
       case 14:  stringOne =  myNumeral[14]; stringThree =  myNumeral[26]; stringHour = "  " + stringOne + " " + stringThree + "  ";break;
       case 15:  stringOne =  myNumeral[15]; stringThree =  myNumeral[26]; stringHour = "  " + stringOne + " " + stringThree + "   ";break;
       case 16:  stringOne =  myNumeral[16]; stringThree =  myNumeral[26]; stringHour = "  " + stringOne + " " + stringThree + "   ";break;
       case 17:  stringOne =  myNumeral[17]; stringThree =  myNumeral[26]; stringHour = "  " + stringOne + " " + stringThree + " ";break;
       case 18:  stringOne =  myNumeral[18]; stringThree =  myNumeral[26]; stringHour = "  " + stringOne + " " + stringThree + "  ";break;
       case 19:  stringOne =  myNumeral[19]; stringThree =  myNumeral[26]; stringHour = "  " + stringOne + " " + stringThree + "  ";break;
       case 20:  stringOne =  myNumeral[20]; stringThree =  myNumeral[26]; stringHour = "   " + stringOne + " " + stringThree + "   ";break;
       case 21:  stringOne =  myNumeral[20]; stringTwo =  myNumeral[1]; stringThree =  myNumeral[26]; stringHour = " " + stringOne + " " + stringTwo + " " + stringThree + " ";break;
       case 22:  stringOne =  myNumeral[20]; stringTwo =  myNumeral[2]; stringThree =  myNumeral[26]; stringHour = " " + stringOne + " " + stringTwo + " " + stringThree + " ";break;
       case 23:  stringOne =  myNumeral[20]; stringTwo =  myNumeral[3]; stringThree =  myNumeral[26]; stringHour = "" + stringOne + "" + stringTwo + "" + stringThree + "";break;
       }
        
  switch (now.minute()) {         // собираем вторую строку
   case 0:  stringFour =  myNumeral[0]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "    ";  break;
    case 1:  stringFour =  myNumeral[1]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "     ";  break;
    case 2:  stringFour =  myNumeral[2]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "     ";  break;
    case 3:  stringFour =  myNumeral[3]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "   ";  break;
    case 4:  stringFour =  myNumeral[4]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "    ";  break;
    case 5:  stringFour =  myNumeral[5]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "    ";  break;
    case 6:  stringFour =  myNumeral[6]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "     ";  break;
    case 7:  stringFour =  myNumeral[7]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "   ";  break;
    case 8:  stringFour =  myNumeral[8]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "   ";  break;
    case 9:  stringFour =  myNumeral[9]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "    ";  break;
    case 10:  stringFour =  myNumeral[10]; stringSix =  myNumeral[31]; stringMin = "\n    " + stringFour + " " + stringSix + "     ";  break;
    case 11:  stringFour =  myNumeral[11]; stringSix =  myNumeral[31]; stringMin = "\n   " + stringFour + " " + stringSix + "   ";  break;
    case 12:  stringFour =  myNumeral[12]; stringSix =  myNumeral[31]; stringMin = "\n   " + stringFour + " " + stringSix + "   ";  break;
    case 13:  stringFour =  myNumeral[13]; stringSix =  myNumeral[31]; stringMin = "\n  " + stringFour + " " + stringSix + "  ";  break;
    case 14:  stringFour =  myNumeral[14]; stringSix =  myNumeral[31]; stringMin = "\n  " + stringFour + " " + stringSix + "   ";  break;
    case 15:  stringFour =  myNumeral[15]; stringSix =  myNumeral[31]; stringMin = "\n  " + stringFour + " " + stringSix + "   ";  break;
    case 16:  stringFour =  myNumeral[16]; stringSix =  myNumeral[31]; stringMin = "\n  " + stringFour + " " + stringSix + "   ";  break;
    case 17:  stringFour =  myNumeral[17]; stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringSix + "  ";  break;
    case 18:  stringFour =  myNumeral[18]; stringSix =  myNumeral[31]; stringMin = "\n  " + stringFour + " " + stringSix + "  ";  break;
    case 19:  stringFour =  myNumeral[19]; stringSix =  myNumeral[31]; stringMin = "\n  " + stringFour + " " + stringSix + "  ";  break;
    case 20:  stringFour =  myNumeral[20]; stringSix =  myNumeral[31]; stringMin = "\n   " + stringFour + " " + stringSix + "   ";  break;
    case 21:  stringFour =  myNumeral[20]; stringFive =  myNumeral[1];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + "  " + stringSix;  break;
    case 22:  stringFour =  myNumeral[20]; stringFive =  myNumeral[2];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + " " + stringSix + " ";  break;
    case 23:  stringFour =  myNumeral[20]; stringFive =  myNumeral[3];stringSix =  myNumeral[32]; stringMin = "\n  " + stringFour + " " + stringFive + " " + stringSix + "  ";  break;
    case 24:  stringFour =  myNumeral[20]; stringFive =  myNumeral[4];stringSix =  myNumeral[31]; stringMin = "\n" + stringFour + " " + stringFive + " " + stringSix + " ";  break;
    case 25:  stringFour =  myNumeral[20]; stringFive =  myNumeral[5];stringSix =  myNumeral[31]; stringMin = "\n" + stringFour + " " + stringFive + " " + stringSix + " ";  break;
    case 26:  stringFour =  myNumeral[20]; stringFive =  myNumeral[6];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + "  " + stringSix;  break;
    case 27:  stringFour =  myNumeral[20]; stringFive =  myNumeral[7];stringSix =  myNumeral[32]; stringMin = "\n " + stringFour + "  " + stringFive + " " + stringSix + "  ";  break;
    case 28:  stringFour =  myNumeral[20]; stringFive =  myNumeral[8];stringSix =  myNumeral[32]; stringMin = "\n " + stringFour + "  " + stringFive + " " + stringSix + "  ";  break;
    case 29:  stringFour =  myNumeral[20]; stringFive =  myNumeral[9];stringSix =  myNumeral[31]; stringMin = "\n" + stringFour + " " + stringFive + " " + stringSix + " ";  break;
    case 30:  stringFour =  myNumeral[21]; stringSix =  myNumeral[31]; stringMin = "\n   " + stringFour + " " + stringSix + "   ";  break;
    case 31:  stringFour =  myNumeral[21]; stringFive =  myNumeral[1];stringSix =  myNumeral[31]; stringMin = "\n" + stringFour + "  " + stringFive + "  " + stringSix;  break;
    case 32:  stringFour =  myNumeral[21]; stringFive =  myNumeral[2];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + " " + stringSix + " ";  break;
    case 33:  stringFour =  myNumeral[21]; stringFive =  myNumeral[3];stringSix =  myNumeral[32]; stringMin = "\n " + stringFour + "  " + stringFive + " " + stringSix + "  ";  break;
    case 34:  stringFour =  myNumeral[21]; stringFive =  myNumeral[4];stringSix =  myNumeral[32]; stringMin = "\n  " + stringFour + "  " + stringFive + " " + stringSix + "  ";  break;
    case 35:  stringFour =  myNumeral[21]; stringFive =  myNumeral[5];stringSix =  myNumeral[32]; stringMin = "\n  " + stringFour + "  " + stringFive + " " + stringSix + "  ";  break;
    case 36:  stringFour =  myNumeral[21]; stringFive =  myNumeral[6];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + "  " + stringSix;  break;
    case 37:  stringFour =  myNumeral[21]; stringFive =  myNumeral[7];stringSix =  myNumeral[32]; stringMin = "\n  " + stringFour + " " + stringFive + " " + stringSix + "  ";  break;
    case 38:  stringFour =  myNumeral[21]; stringFive =  myNumeral[8];stringSix =  myNumeral[32]; stringMin = "\n  " + stringFour + " " + stringFive + " " + stringSix + "  ";  break;
    case 39:  stringFour =  myNumeral[21]; stringFive =  myNumeral[9];stringSix =  myNumeral[32]; stringMin = "\n " + stringFour + "  " + stringFive + "  " + stringSix + "  ";  break;
    case 40:  stringFour =  myNumeral[22]; stringSix =  myNumeral[31]; stringMin = "\n   " + stringFour + " " + stringSix + "    ";  break;
    case 41:  stringFour =  myNumeral[22]; stringFive =  myNumeral[1];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + " " + stringSix + "  ";  break;
    case 42:  stringFour =  myNumeral[22]; stringFive =  myNumeral[2];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + " " + stringSix + "  ";  break;
    case 43:  stringFour =  myNumeral[22]; stringFive =  myNumeral[3];stringSix =  myNumeral[31]; stringMin = "\n" + stringFour + " " + stringFive + " " + stringSix + " ";  break;
    case 44:  stringFour =  myNumeral[22]; stringFive =  myNumeral[4];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + " " + stringSix + " ";  break;
    case 45:  stringFour =  myNumeral[22]; stringFive =  myNumeral[5];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + " " + stringSix + " ";  break;
    case 46:  stringFour =  myNumeral[22]; stringFive =  myNumeral[6];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + " " + stringSix + "  ";  break;
    case 47:  stringFour =  myNumeral[22]; stringFive =  myNumeral[7];stringSix =  myNumeral[32]; stringMin = "\n  " + stringFour + "  " + stringFive + " " + stringSix + "  ";  break;
    case 48:  stringFour =  myNumeral[22]; stringFive =  myNumeral[8];stringSix =  myNumeral[32]; stringMin = "\n  " + stringFour + "  " + stringFive + " " + stringSix + "  ";  break;
    case 49:  stringFour =  myNumeral[22]; stringFive =  myNumeral[9];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + " " + stringSix + " ";  break;
    case 50:  stringFour =  myNumeral[23]; stringSix =  myNumeral[31]; stringMin = "\n  " + stringFour + "   " + stringSix + "   ";  break;
    case 51:  stringFour =  myNumeral[23]; stringFive =  myNumeral[1];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + " " + stringSix + "  ";  break;
    case 52:  stringFour =  myNumeral[23]; stringFive =  myNumeral[2];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + "  " + stringFive + "  " + stringSix;  break;
    case 53:  stringFour =  myNumeral[23]; stringFive =  myNumeral[3];stringSix =  myNumeral[32]; stringMin = "\n  " + stringFour + "  " + stringFive + "   " + stringSix;  break;
    case 54:  stringFour =  myNumeral[23]; stringFive =  myNumeral[4];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + "  " + stringSix;  break;
    case 55:  stringFour =  myNumeral[23]; stringFive =  myNumeral[5];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + "  " + stringSix;  break;
    case 56:  stringFour =  myNumeral[23]; stringFive =  myNumeral[6];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + "  " + stringFive + " " + stringSix  + " ";  break;
    case 57:  stringFour =  myNumeral[23]; stringFive =  myNumeral[7];stringSix =  myNumeral[32]; stringMin = "\n   " + stringFour + "  " + stringFive + "  " + stringSix;  break;
    case 58:  stringFour =  myNumeral[23]; stringFive =  myNumeral[8];stringSix =  myNumeral[32]; stringMin = "\n  " + stringFour + "  " + stringFive + "   " + stringSix;  break;
    case 59:  stringFour =  myNumeral[23]; stringFive =  myNumeral[9];stringSix =  myNumeral[31]; stringMin = "\n " + stringFour + " " + stringFive + "  " + stringSix;  break;
    }

             
              mySerial.println(stringHour);   //печать первой строки
              mySerial.print(stringMin);      // печать второй строки
    delay(500);
  }
  else {         
           
           den = now.day();
           mec = now.month();
           god = now.year();
           agod = (14 - mec) / 12;
           ygod = god - agod;
           mgod = mec + 12 * agod - 2;           
           dday = ( den + ygod + (ygod / 4) - ( ygod / 100 ) + (ygod / 400 ) + (31 * mgod) / 12)  %7;               // вычисление дня недели
           //Serial.print(dday);
           
           
           stringHourdd = now.hour(); stringMindd = (now.minute());stringSecdd = now.second(), stringDatyd = now.day(), stringGod = now.year(), stringGodn = myNumeral[52]  ;
           
           switch (dday) {                                                                       // блок имени дня недели
           case 0:   stringdday = stringddayy + "     "; stringddayy =myNumeral[39]; break; 
           case 1:   stringdday = stringddayy + "     "; stringddayy =myNumeral[33]; break;
           case 2:   stringdday = stringddayy + "    "; stringddayy =myNumeral[34]; break;
           case 3:   stringdday = stringddayy + "  "; stringddayy = myNumeral[35]; break;
           case 4:   stringdday = stringddayy + "   "; stringddayy = myNumeral[36]; break;
           case 5:   stringdday = stringddayy + "     "; stringddayy = myNumeral[37]; break;
           case 6:   stringdday = stringddayy + "   "; stringddayy = myNumeral[38]; break;
      }

           switch (now.month()) {                                                                  // блок имени месяца
           case 1:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[40]; break;
           case 2:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[41]; break;
           case 3:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[42]; break;
           case 4:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[43]; break;
           case 5:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[44]; break;
           case 6:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[45]; break;
           case 7:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[46]; break;
           case 8:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[47]; break;
           case 9:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[48]; break;
           case 10:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[49]; break;
           case 11:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[50]; break;
           case 12:   stringdmonth = stringdmonthh + "     "; stringdmonthh = myNumeral[51]; break;
      }
           
           if (now.hour() < 10)   // это нолики перед часами до 10
           {
            stringHourd = '0' + stringHourdd;
           }
           else
           {
            stringHourd = stringHourdd;
           }
           
           
           if (now.minute() < 10)   // это нолики перед минутами до 10
           {
            stringMind = '0' + stringMindd;
           }
           else
           {
            stringMind = stringMindd;
           }

           
           if (now.second() < 10)   // это нолики перед секундами до 10
           {
            stringSecd = '0' + stringSecdd;
           }
           else
           {
            stringSecd = stringSecdd;
           }


           if (now.day() < 10)   // это нолики перед датой до 10
           {
            stringDaty = '0' + stringDatyd;
           }
           else
           {
            stringDaty = stringDatyd;
           }

          
           stringPerd = stringHourd + ':' + stringMind + ':' + stringSecd + " " + stringdday;       // собираем первую строку
           stringVtor = "\r\n" + stringDaty + " " + stringdmonth +  stringGod + " " + stringGodn;   // собираем вторую строку



           
    
              mySerial.println(stringPerd);  // печатаем первую строку
              mySerial.print(stringVtor);    // а это вторую
 delay(100);
  }

}
    
Mirko Pavleski
Electronics , Arduino , Physics

Categories