Go Down

Topic: Code to communicate between two WIR-1186 modules (Read 235 times) previous topic - next topic

Bhuvi_rao

Hey all!
I am using WIR-1186 modules for wireless communication between two ARDUINO UNOs. But, I am just not able to figure out how. Can some one please guide me through?

The connections are:
WIR-1186------------Arduino UNO
VCC------------------3.3V
GND------------------GND
TXD-------------------RXD(Pin 0)
RXD-------------------TXD(Pin 1)
PROG------------------Pin 2
CTS--------------------Pin 3


I have attached the data sheet, the sender and receiver codes I wrote on my own.
I found a library WIR-Arduino-master on GitHub which didn't serve me of any help.


Please help me at the earliest since I have my project due in a week :'(

You could also e-mail me at Moderator edit: plain-text email address removed




Thanks in advance :D

TomGeorge

Hi,
Welcome to the Forum.

Have you googled     WIR-1186 module arduino

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

Bhuvi_rao

yeah, i have, but no working code found. i've tried googling for it in all the ways possible

TomGeorge

#3
Jan 19, 2019, 10:23 am Last Edit: Jan 19, 2019, 10:24 am by TomGeorge
Hi,

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you tell us your electronics, programming, arduino, hardware experience?


Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

TomGeorge

Hi,
Please post link to GitHub file.

Does you code compile?

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

Bhuvi_rao

https://github.com/askmuhsin/WIR-Arduino

I dont understand what to make of this. I am not able to use these library functions in my code. Hence, i created my own code which complies and runs perfectly, but without giving required output

Grumpy_Mike

Quote
and runs perfectly, but without giving required output
An odd usage of the word perfectly to which I was previously unaware.
What is it doing that is perfect?

How does that last answer match the request for you to post your code?

Bhuvi_rao

this if my code for the sender. it is the same for the reciever as well, but with the Serial.println("RECIEVER");
mySerial.println("RECIEVER");

What I mean by it running perfectly is,
It displays SENDER and RECEIVER on the serial monitors of the TRANSMITTING and RECEIVING arduino UNOs respectively.

But the RECEIVING arduino doesnt display 'SENDER' string and vice versa. That's my problem.
Code: [Select]



#include <SoftwareSerial.h>
#include "Arduino.h"
#include "WIR.h"
int Prog=2;
int CTS=4;

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  mySerial.begin(9600);
 pinMode(Prog, OUTPUT);
  digitalWrite(Prog, LOW);
 
  delay(10000);
  digitalWrite(Prog,HIGH);
 
  pinMode(CTS,INPUT);
 
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.println("SENDER");


 
  mySerial.println("SENDER");
}

void loop() { // run over and over

  {if (mySerial.available()) {
    Serial.println("mySerial Available");
    Serial.write(mySerial.read());
     //Serial.println(mySerial.read());
  }
 
 
  if (Serial.available()) {
    Serial.println("Serial Available");
    mySerial.write(Serial.read());
     mySerial.println(Serial.read());
  }
}}



Go Up