Hello!
I recently ran into a really strange problem.
I was trying to send multiple digit integers to set a clock for a project I'm working on.
But I noticed that numbers were not send/received correctly.
The simplify the issue, I created a test program:
Arduino Code:
byte aIn;
void setup() {
Serial.begin(115200);
}
void loop() {
if(Serial.available()){
aIn = Serial.read();
Serial.write(aIn);
Serial.write(' ');
Serial.println(aIn);
}
}
Console Output: (First sending individual characters (1,2,3) and then all three a once (123), no line ending)
1 49 //Send: 1
2 50 //Send: 2
3 51 //Send: 3
1 49 //Send: 123
¦ 166
þ 254
It is working fine on my Arduino Leonardo R3, but not on my ATMEGA32 (using MightyCore for Compatibility).
My Board Settings are attached, I upload using my USBtinyISP and an FTDI for the Serial Interface.
MightyCore: GitHub - MCUdude/MightyCore: Arduino hardware package for ATmega1284, ATmega644, ATmega324, ATmega324PB, ATmega164, ATmega32, ATmega16 and ATmega8535
USBtinyISP: USB Tiny ISP Programmer mit Cable 6/10pin für AVR ATMEGA Arduino CP12010 | eBay
FTDI: Geekcreit® FT232RL FTDI USB To TTL Serial Converter Adapter Module Geekcreit for Arduino - products that work with official Arduino boards Sale - Banggood USA
I'm not new to programming and I've done a lot with Arduino/AVR.
This problem applies to all characters I send, not just numbers.
I hope someone can help me.
Have a nice day!