Hello, I'm trying to use an arduino micro to communicate using the serial pins rx/tx.
To test the communication connected pins rx/tx to a serial to USB adapter and run this code:
/*
TEST SERIAL0 (USB) e SERIAL1 ( RX/TX PINs)
*/
int IntTesto = 0;
char CharTesto = 33;
void setup() {
// initialize serial communication at 9600 bits per second: Standard 8-N-1
Serial.begin(9600, SERIAL_8N1);
Serial1.begin(9600,SERIAL_8N1);
delay(1000);
}
void loop() {
IntTesto = 0;
for (int i = 0; i <= 50; i++) {
Serial.print(IntTesto);
Serial1.print(IntTesto);
delay(300);
IntTesto = IntTesto + 1;
}
Serial.println();
Serial1.println();
CharTesto = 33;
for (int i = 0; i <= 64; i++) {
Serial.write(CharTesto);
Serial1.write(CharTesto);
delay(100);
CharTesto = CharTesto + 1;
}
Serial.println();
Serial1.println();
}
Everything works well with the USB port but monitoring the serial port only produced gibberish characters
Anyone can help me out?
Thank you.
