Update link and pictures
parent
0f38115399
commit
3699722e31
41
README.md
41
README.md
|
@ -1,14 +1,14 @@
|
|||
# [Digital Clock](https://zzncx.top/posts/digital-clock-part-5/)
|
||||
# [Digital Clock](https://zzncx.top/posts/digital-clock-part-6/)
|
||||
|
||||
Arduino based digital clock.
|
||||
|
||||
[](https://zzncx.top/posts/digital-clock-part-5/tidy-regless-promini-sideway.jpg)
|
||||
[](https://zzncx.top/posts/digital-clock-part-5/digital-clock-part-5_bb.png)
|
||||
[](https://zzncx.top/posts/digital-clock-part-5/digital-clock-part-5_schem.png)
|
||||
[](https://zzncx.top/posts/digital-clock-part-6/running-without-wallwart.jpg)
|
||||
[](https://zzncx.top/posts/digital-clock-part-6/digital-clock-part-6_bb.png)
|
||||
[](https://zzncx.top/posts/digital-clock-part-6/digital-clock-part-6_schem.png)
|
||||
|
||||
## Compiling
|
||||
|
||||
To be able to compile this, you need to modify the [LcdMenu](https://github.com/forntoh/LcdMenu/tree/2.1.0) library. Edit the [LcdMenu.h](https://github.com/forntoh/LcdMenu/blob/2.1.0/src/LcdMenu.h#L767-L775) from the LcdMenu library, find this:
|
||||
To be able to compile this, you need to modify the [LcdMenu](https://github.com/forntoh/LcdMenu/tree/2.1.0) library. Edit the [LcdMenu.h](https://github.com/forntoh/LcdMenu/blob/2.1.0/src/LcdMenu.h#L767-L775) file from the LcdMenu library, find this:
|
||||
```cpp
|
||||
/**
|
||||
* Toggle backlight
|
||||
|
@ -34,3 +34,34 @@ Replace it to this:
|
|||
#endif
|
||||
}
|
||||
```
|
||||
|
||||
Other than that, if you get warnings like this:
|
||||
```plaintext
|
||||
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](https://github.com/forntoh/LcdMenu/tree/2.1.0) library. Edit the [MenuItem.h](https://github.com/forntoh/LcdMenu/blob/2.1.0/src/MenuItem.h#L306-L313) file from the LcdMenu library,find this:
|
||||
```cpp
|
||||
/**
|
||||
* @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:
|
||||
```cpp
|
||||
/**
|
||||
* @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) {}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue