-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
type: bugSomething isn't working.Something isn't working.
Description
Is there an existing issue for this?
- I have searched the existing issues.
Library version
Yes, from Arduino library manager.
Bug description
What is happening?
When using a LiquidLine with a double variable, the menu output prints '0.00'.
With LIQUIDMENU_DEBUG true set the debug messages show the double value being parsed as a float:
#include "Arduino.h"
#include "LiquidCrystal_I2C.h"
#include "LiquidMenu.h"
double _tst = 0;
LiquidCrystal_I2C lcd(0x3F, 16, 2);
LiquidLine _testLine(1, 0, "Test: ", _tst);
LiquidScreen _mainScreen(_testLine);
LiquidMenu _menu(lcd);
//The setup function is called once at startup of the sketch
void setup()
{
lcd.init();
lcd.backlight();
_menu.init();
_menu.add_screen(_mainScreen);
}
void loop()
{
_tst++;
_menu.update();
delay(1000);
}12:35:37: Updating the LCD
12:35:37: ----------------------------------------
12:35:37: |Screen 0
12:35:37: | Line 0 (1, 0)
12:35:37: | (const char*)Test: (float)0.00
12:35:37: ----------------------------------------
If the _tst variable is changed to type float, the variable value is printed correctly. The primary variable needs to be of type double for compatibility with external libraries, and it appears that LiquidMenu should support doubles without needing conversion of every double variable.
What should be happening?
The menu should display the actual value of the double variable without needing conversion to float.
Compiler output
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: bugSomething isn't working.Something isn't working.