instrumentek
Well-known member
Hi;
I have an issue that I'm hoping someone can point me in the correct direction. EEPROMEX function EEPROM.readInt returns an incorrect value on teensy 3.5 but returns correct value using the teensy 2.0++.
Arduino 1.6.12
teensy loader 1.19
using both:
teensy 2.0++ (works correctly)
teensy 3.5 (does not work correctly)
If I load this program using the same IDE and teensy loader onto the 2 different teensies the output gives two different responses.
responce from teensy 2.0++:
responce from teensy 3.5:
I have noticed that if you take the responce from the 3.5 and apply math you can get the correct value EX. 64302 - (2^16) = -1234 I could use this to correct my problem but I would like to understand this issue before I make the changes. I have tried the several different teencies as well as the newest version of EEPROMEX from github.
Thanks for any advice
I have an issue that I'm hoping someone can point me in the correct direction. EEPROMEX function EEPROM.readInt returns an incorrect value on teensy 3.5 but returns correct value using the teensy 2.0++.
Arduino 1.6.12
teensy loader 1.19
using both:
teensy 2.0++ (works correctly)
teensy 3.5 (does not work correctly)
If I load this program using the same IDE and teensy loader onto the 2 different teensies the output gives two different responses.
Code:
#include <EEPROMex.h>
int test = 0;
void setup()
{
Serial.begin(9600);
EEPROM.writeInt(10, 1234);
EEPROM.writeInt(20, -1234);
}
void loop()
{
Serial.print("1234: ");
test = EEPROM.readInt(10);
Serial.println(test);
Serial.print("-1234: ");
test = EEPROM.readInt(20);
Serial.println(test);
delay(1000);
}
responce from teensy 2.0++:
Code:
1234: 1234
-1234: -1234
responce from teensy 3.5:
Code:
1234: 1234
-1234: 64302
I have noticed that if you take the responce from the 3.5 and apply math you can get the correct value EX. 64302 - (2^16) = -1234 I could use this to correct my problem but I would like to understand this issue before I make the changes. I have tried the several different teencies as well as the newest version of EEPROMEX from github.
Thanks for any advice