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
String(negativeInteger, HEX) doesn't return the same thing than with an Arduino UNO.
Settings in IDE
Module: NodeMCU 1.0
Flash Size: 4MB/3MB
CPU Frequency: 80Mhz
Upload Using: SERIAL
Reset Method: nodemcu
Sketch
long a;
void setup() {
// put your setup code here, to run once:
a = -100;
delay(500);
Serial.begin(9600);
Serial.println(String(a,HEX));
}
void loop() {
// put your main code here, to run repeatedly:
}
Serial Output
-64
Exact same code, uploaded to UNO
ffffff9c
Strange, isn't it? I supposed String library was platform independant... I was wrong.
Uno version sounds better to me....
The text was updated successfully, but these errors were encountered:
Our ltoa doesn't behave correctly for negative, non base10 #s. It should be safe to replace the shim functions in core_esp8266_noniso.c with calls to itoa and utoa since long and int are the same size.
Use the newlib integer-to-ASCII non-POSIX calls instead of rolling
our own. Should be safe as sizeof(long) == sizeof(int).
The custom functions behaved differently from itoa when passed in
negative values in non-base-10.
Fixes bug esp8266#2813
Basic Infos
Hardware
Hardware: NodeMCU ESP-12E
Core Version: 2.3.0
Description
String(negativeInteger, HEX) doesn't return the same thing than with an Arduino UNO.
Settings in IDE
Module: NodeMCU 1.0
Flash Size: 4MB/3MB
CPU Frequency: 80Mhz
Upload Using: SERIAL
Reset Method: nodemcu
Sketch
Serial Output
-64
Exact same code, uploaded to UNO
ffffff9c
Strange, isn't it? I supposed String library was platform independant... I was wrong.
Uno version sounds better to me....
The text was updated successfully, but these errors were encountered: