I am using an radar which is based on rs232 output data. I use MAX232 to TTL convertor with arduino. Radar givs data in 14 byte in hex i want to read it on serial monitor. what can i do ,Below i use sofwareserial.h library to read data but failed
#include <SoftwareSerial.h>
const int TX_PIN = 3; // Replace with your actual TX pin
SoftwareSerial mySerial(RX_PIN, TX_PIN);
void setup() {
Serial.begin(115200); // Serial monitor for debugging
mySerial.begin(115200); // SoftwareSerial for connecting to the MAX232
}
void loop() {
// Check for and print the raw data from the radar
printRawRadarData();
}
void printRawRadarData() {
// Check if data is available from the MAX232
while (mySerial.available()) {
char receivedChar = mySerial.read();
Serial.print(receivedChar,HEX);
}
}
10 posts - 6 participants