You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I store a positive signed value (e.g. top["testInt"] = (int)43;) I can't read the same value out into an unsigned variable (unsigned int tempUInt = top["testInt"];), I just get 0.
This is probably an odd use case but I do have a good reason for doing this in some software where user extendable code is communicating with the main library code only through an ArduinoJson document.
The text was updated successfully, but these errors were encountered:
embedded-creations
changed the title
Storing positive value as an int can't be read as unsigned int
Storing positive value from an int can't be read into an unsigned int
Jun 29, 2021
If I store a positive signed value (e.g.
top["testInt"] = (int)43;
) I can't read the same value out into an unsigned variable (unsigned int tempUInt = top["testInt"];
), I just get 0.This is probably an odd use case but I do have a good reason for doing this in some software where user extendable code is communicating with the main library code only through an ArduinoJson document.
This simple example shows the problem:
Result:
Tested on Teensy 3.6 and ESP32. Compiler output from Teensy 3.6:
The text was updated successfully, but these errors were encountered: