/*
Solution For:
Topic: How to declare callback with Printable return type?
Category: Programming Questions
Link: https://forum.arduino.cc/t/how-to-declare-callback-with-printable-return-type/1116702/15
Date: 19-Apr-23 MicroBeaut (μB)
- Added `unsigned long` to `LCD_I2C_Extended.h`
*/
#include "LCD_I2C_Extended.h"
LCD_I2C_Extended lcd (0x27, 16, 2);
String testCallbacks() {
return "Potatoes!";
}
String testCallbacks2() {
return "Apple!";
}
unsigned long testCallbacks3() {
return -1; // Value = 4294967295 (Max)
}
void setup() {
Serial.begin(9600);
//lcd.init();
lcd.addCallback(testCallbacks);
lcd.addCallback(testCallbacks2);
lcd.addCallback(testCallbacks3);
}
void loop() {
lcd.update();
}