String(zahl) ? why are you using strings? use character arrays, uses less resources without the heap destructions
Hm, my arduino does not allow to paste a sreenshot :-(
see this thread: https://forum.pjrc.com/threads/46866-string-help
Also posting an image of your code makes it impossible to copy and paste the code into an IDE window - few are going
to help you if you force them to type in your code by hand(!)
Here the code:
I don't want to discuss the use of String, string or char arrays. It is simple why doesn't it work, it is standard c++11 function#include <string>
using namespace std;
uint8_t zahl = 10;
string zahlString;
void setup() {
zahlString = to_string(zahl);
}
void loop() {
}
AFAIK you need to use at least GCC 6 for this. I just tested your code with gcc-arm-none-eabi-9-2019-q4. And it compiles without issue. There are a few discussions about this issue on Stackoverflow.
Is there a simple way to change the compiler version? And why does Teensy use an old version? Normally I work on PlatformIO.
https://github.com/TeensyUser/doc/wiki/GCC
Scroll down to "Switching between different toolchains". I'm usually using VisualTeensy where switching is done by simply changing the setting for the GCC folder. If you find out how to do it in PlatformIO it would be great if you could add some info to the WIKI
Tried with following .ini on platformIO
getting following resultCode:[env:teensy41] platform = teensy board = teensy41 framework = arduino platform_packages = toolchain-gccarmnoneeabi@>1.90000.0
Code:Linking .pio/build/teensy41/firmware.elf /Users/sstaub/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: cannot find -larm_cortexM7lfsp_math
Yes, the Wiki link shows how to fix this
I want to try it for Teensyduino app, but the wiki doesn't help me, I'm working on macOS. The path for Arduino/hardware/tools is different to windows.
On mac there is a user folder Documents/Arduino/hardware which is empty and in Library/Arduino15/packages I can't find the files for Teensy.
Maybe the Teensyduino IDE have another path on mac then the Arduino IDE.
Stuff's in /Applications/Teensyduino.app/Contents/Java/hardware/teensy/ for me....
Followed the wiki and changed to gcc-arm-none-eabi-9-2019-q4. No luck, I get alwaysCode:cannot find -larm_cortexM7lfsp_math
Looks like you didn't copy the libraries to the correct path? Unless the GCC folder structure is different for a MAC, they need to go into the MAC equivalent of this WIN10 folder:
...\gcc-arm-none-eabi-9_3-2020-q2\arm-none-eabi\lib
Activating verbose output in Arduino and PIO should help finding the correct folders.
Last edited by luni; 03-28-2021 at 08:09 AM.
The file libarm_cortexM7lfsp_math.a is missing in gcc versions higher than 1.5 and must manually copied. wtf
IMHO, If it is not there it should not be used!
the fact that Arduino/Makefiles are not adapting to changing gcc is not the problem of gcc
maybe there is an equivalent library, or installation of toolchain is not complete.
BTW, even if you abbreviate to three letters, it is NOT cool to use insults on a technical forum.