I've included my serial to serial test sketch but the esp32 just stops working straight away
Backtrace: 0x40080a84:0x3ffc7210 0x400d05a7:0x3ffc7230 0x400d66f2:0x3ffc7270
CPU halted.
code:
Code: Select all
void setup() {
pinMode (9, FUNCTION_4); // U1RXD
pinMode (10, FUNCTION_4); // U1TXD
HardwareSerial Serial1(1);
Serial1.begin(9600,SERIAL_8N1,10,9);
Serial.begin(9600);
}
void loop() {
Serial.println("coms test");
if (HardwareSerial(1).available()) {
int inByte = HardwareSerial(1).read();
Serial.write(inByte);
}
// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
HardwareSerial(1).write(inByte);
}
}
what am i doing wrong