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

Increase buffer size for converting floats + doubles to String's #163

Closed
wants to merge 1 commit into from

Conversation

sandeepmistry
Copy link
Contributor

Previously it was too small to print FLT_MAX and DBL_MAX.

Troublesome sketch:

#include <float.h> 

void setup() {
  Serial.begin(9600);
  while (!Serial);

  Serial.println(String(FLT_MAX));
  Serial.println(String(DBL_MAX));
  Serial.println(String(-FLT_MAX));
  Serial.println(String(-DBL_MAX));
}

void loop() {
}

Previously it was too small to print FLT_MAX and DBL_MAX
@sandeepmistry
Copy link
Contributor Author

If this is merged, it also needs to be ported to the 101 core.

@Ivan-Perez
Copy link

Is that code correct? You shouldn't declare an array whose size is not available at compilation time.

I can't test it now, but if you enable all warnings the compiler should emit one because of it. Any way, as I'm reading here, g++ may allow it as an extension, but it is not valid C++.

@ArduinoBot
Copy link

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/samd/package_samd-b148_index.json

ℹ️ To test this build:

  1. Open the Preferences of the Arduino IDE.
  2. Add the Build URL above in the Additional Boards Manager URLs field, and click OK.
  3. Open the Boards Manager (menu Tools->Board->Board Manager...)
  4. Install Arduino SAMD core - Pull Request Increase buffer size for converting floats + doubles to String's #163
  5. Select one of the boards under SAMD Pull Request Increase buffer size for converting floats + doubles to String's #163 in Tools->Board menu
  6. Compile/Upload as usual

@arduino arduino deleted a comment from ArduinoBot Jul 6, 2017
@cmaglie cmaglie added this to the Release 1.6.17 milestone Sep 1, 2017
@ArduinoBot
Copy link

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/samd/package_samd-b177_index.json

ℹ️ To test this build:

  1. Open the Preferences of the Arduino IDE.
  2. Add the Build URL above in the Additional Boards Manager URLs field, and click OK.
  3. Open the Boards Manager (menu Tools->Board->Board Manager...)
  4. Install Arduino SAMD core - Pull Request Increase buffer size for converting floats + doubles to String's #163
  5. Select one of the boards under SAMD Pull Request Increase buffer size for converting floats + doubles to String's #163 in Tools->Board menu
  6. Compile/Upload as usual

@ArduinoBot
Copy link

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/samd/package_samd-b206_index.json

ℹ️ To test this build:

  1. Open the Preferences of the Arduino IDE.
  2. Add the Build URL above in the Additional Boards Manager URLs field, and click OK.
  3. Open the Boards Manager (menu Tools->Board->Board Manager...)
  4. Install Arduino SAMD core - Pull Request Increase buffer size for converting floats + doubles to String's #163
  5. Select one of the boards under SAMD Pull Request Increase buffer size for converting floats + doubles to String's #163 in Tools->Board menu
  6. Compile/Upload as usual

@aentinger
Copy link
Contributor

Closing this because it will be done in arduino/ArduinoCore-API#128 instead.

@aentinger aentinger closed this Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants