Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 LiquidLine 'double' variables not being printed. #117

Open
1 task done
crankysyntax opened this issue Sep 27, 2024 · 0 comments
Open
1 task done

ESP32 LiquidLine 'double' variables not being printed. #117

crankysyntax opened this issue Sep 27, 2024 · 0 comments
Labels
type: bug Something isn't working.

Comments

@crankysyntax
Copy link

crankysyntax commented Sep 27, 2024

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

@crankysyntax crankysyntax added the type: bug Something isn't working. label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

1 participant