DIY digital clock based on Arduino.
 
 
Go to file
Joshua R. T. Purba 3699722e31 Update link and pictures 2022-02-07 03:47:49 +07:00
.vscode Digital clock with Arduino Pro Mini 2021-12-02 00:30:41 +07:00
include Digital clock with Arduino Pro Mini 2021-12-02 00:30:41 +07:00
lib Digital clock with Arduino Pro Mini 2021-12-02 00:30:41 +07:00
src Use Low-Power library and remove Analog Buttons library. 2022-02-06 23:57:37 +07:00
test Digital clock with Arduino Pro Mini 2021-12-02 00:30:41 +07:00
.gitignore Digital clock with Arduino Pro Mini 2021-12-02 00:30:41 +07:00
LICENSE Digital clock with Arduino Pro Mini 2021-12-02 00:30:41 +07:00
README.md Update link and pictures 2022-02-07 03:47:49 +07:00
platformio.ini Use Low-Power library and remove Analog Buttons library. 2022-02-06 23:57:37 +07:00

README.md

Digital Clock

Arduino based digital clock.

Breadboarded project Breadboard diagram Electronics schematic

Compiling

To be able to compile this, you need to modify the LcdMenu library. Edit the LcdMenu.h file from the LcdMenu library, find this:

    /**
     * Toggle backlight
     */
    void toggleBacklight() {
        MenuItem* item = &currentMenuTable[cursorPosition];
        if (item->getType() == MENU_ITEM_TOGGLE) {
            lcd->setBacklight(item->isOn);
        }
    }

Replace it to this:

    /**
     * Toggle backlight
     */
    void toggleBacklight() {
        #ifndef USE_STANDARD_LCD
        MenuItem* item = &currentMenuTable[cursorPosition];
        if (item->getType() == MENU_ITEM_TOGGLE) {
            lcd->setBacklight(item->isOn);
        }
        #endif
    }

Other than that, if you get warnings like this:

src/main.cpp:71:53: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   ItemToggle("Alarm", "Yes", "No", cbMenuToggleAlarm),
                                                     ^
src/main.cpp:71:53: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

You can make the warning go away by modifying the the LcdMenu library. Edit the MenuItem.h file from the LcdMenu library,find this:

    /**
     * @param key key of the item
     * @param textOn display text when ON
     * @param textOff display text when OFF
     * @param callback reference to callback function
     */
    ItemToggle(const char* key, char* textOn, char* textOff, fptrInt callback)
        : MenuItem(key, textOn, textOff, callback, MENU_ITEM_TOGGLE) {}

Replace it to this:

    /**
     * @param key key of the item
     * @param textOn display text when ON
     * @param textOff display text when OFF
     * @param callback reference to callback function
     */
    ItemToggle(const char* key, const char* textOn, const char* textOff, fptrInt callback)
        : MenuItem(key, textOn, textOff, callback, MENU_ITEM_TOGGLE) {}