Jump to content
  • 0

RS232 communication with Arduino


Karthi

Question

Hello

 

I'm trying to communicate with an RS232 flow meter through an Arduino board and Diligent PMOD RS232. I have this code written, but I'm not able to receive anything back. 

 

#include <SoftwareSerial.h>

const byte rxPin = 8;
const byte txPin = 9;
SoftwareSerial bronkhorst (rxPin,txPin);

void setup() {
  // put your setup code here, to run once:
  pinMode(rxPin,INPUT);
  pinMode(txPin,OUTPUT);
  
  bronkhorst.begin(38400);
  Serial.begin(38400);
}

void loop() {
  // put your main code here, to run repeatedly:
  bronkhorst.write(":068004744F744F\r\n");
  char c = bronkhorst.read();
  Serial.write(c);
  delay(1000);
}

 

Is there any way I could check if the module works without any equipment connected? 

 

Thank you

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...