Hey everyone,
I'm trying to port a measurement program from the Arduino Nano Every to Teensy 4.0. The program is using the BigNumber library (see: https://github.com/nickgammon/BigNumber); I've attached a copy of the library to this post.
Unfortunately, when trying to declare BigNumber variables as class members or global variables, the Teensy board seemingly crashes after uploading the code.
Here's a very basic program that reproduces the problem:
After uploading this code, the program never enters the loop method. When the BigNumber variable declaration is commented out, the built-in LED starts blinking as expected.
Note that the following does execute successfully (the LED starts blinking and when opening a serial monitor it is receiving the correct number):
Any ideas as to what might be causing this? Or how I might be able to work around this issue? The BigNumber type is used extensively in the code that I'm porting, so it would be a pain to have to use a different library.
Cheers,
Jacques
I'm trying to port a measurement program from the Arduino Nano Every to Teensy 4.0. The program is using the BigNumber library (see: https://github.com/nickgammon/BigNumber); I've attached a copy of the library to this post.
Unfortunately, when trying to declare BigNumber variables as class members or global variables, the Teensy board seemingly crashes after uploading the code.
Here's a very basic program that reproduces the problem:
Code:
#include <BigNumber.h>
BigNumber testNum;
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(100000);
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
delay(100);
}
After uploading this code, the program never enters the loop method. When the BigNumber variable declaration is commented out, the built-in LED starts blinking as expected.
Note that the following does execute successfully (the LED starts blinking and when opening a serial monitor it is receiving the correct number):
Code:
#include <BigNumber.h>
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(100000);
BigNumber::begin(16);
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
delay(100);
BigNumber testNum = BigNumber("1234567890.1234567890");
Serial.println(testNum);
}
Any ideas as to what might be causing this? Or how I might be able to work around this issue? The BigNumber type is used extensively in the code that I'm porting, so it would be a pain to have to use a different library.
Cheers,
Jacques