i am sending data wireless using rf module to arduino from my pc and i want to see the received data in the serial monitor simultaneously. is this possible ??
There should be no problem if the Arduino is connected to the PC using the USB cable.
How is the Arduino connected to the RF module?
Have you a link to the specifications for the module?
Post your code here (please do it properly using the # button).
...R
this is the code iam using. this is to control two motors . i have connected the data pin of the rf receiver module to the rx pin of arduino. the problem iam facing is that if iam connection usb cable arduino is not receiving the wireless data.
int M1_A = 9;
int M1_B = 10;
int M2_A = 12;
int M2_B = 8;
int LED = 13;
int val;
void setup()
{
pinMode(LED, OUTPUT);
pinMode(M1_A, OUTPUT);
pinMode(M1_B, OUTPUT);
pinMode(M2_A, OUTPUT);
pinMode(M2_B, OUTPUT);
Serial.begin(9600);
delay(2500);
}
void loop()
{
if (Serial.available() > 0)
{
val = Serial.read();
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
Serial.print(val);
if (val == 'f')
{
Serial.print(val);
digitalWrite(M1_A, LOW);
digitalWrite(M1_B, HIGH);
digitalWrite(M2_B, HIGH);
digitalWrite(M2_A, LOW);
delay(25);
}
else if (val == 'b')
{
Serial.print(val);
digitalWrite(M1_B, LOW);
digitalWrite(M1_A, HIGH);
digitalWrite(M2_A, HIGH);
digitalWrite(M2_B, LOW);
delay(25);
}
else if (val == 'l')
{
Serial.print(val);
digitalWrite(M1_A, LOW);
digitalWrite(M1_B, LOW);
digitalWrite(M2_A, LOW);
digitalWrite(M2_B, HIGH);
delay(25);
}
else if (val == 'r')
{
Serial.print(val);
digitalWrite(M1_B, HIGH);
digitalWrite(M1_A, LOW);
digitalWrite(M2_B, LOW);
digitalWrite(M2_A, LOW);
delay(25);
}
else if(val == 's')
{
Serial.print(val);
digitalWrite(M1_B, LOW);
digitalWrite(M1_A, LOW);
digitalWrite(M2_B, LOW);
digitalWrite(M2_A, LOW);
}
}
}
I am working on a project where I am the characters f,b,l,r,s using matlab via serial port to an RF transmitter. On the other side, the receiver is attached to an Arduino. The matlab code is sending numbers and the Arduino program is meant to receive these numbers and use them to control two motors. However, for some reason, the Arduino program is not receiving the number right and hence the motor is not functioning as required. how do i solve this? please someone help me....
You haven't posted a link to the specifications for the RF transmitter and receiver.
What Arduino are you using?
You can't expect to receive data on the Serial connection from your RF device and to send data to the PC with the same Serial connection. An Uno has only one hardware serial connection (pins 0 and 1) so you could use SoftwareSerial to create another serial connection on two other pins. Use SoftwareSerial for your RF device. How to use SoftwareSerial is in the Reference section.
...R
this is the code iam using. this is to control two motors . i have connected the data pin of the rf receiver module to the rx pin of arduino. the problem iam facing is that if iam connection usb cable arduino is not receiving the wireless data.
You have a couple things going on. Have you tried skipping the rf devices and using wires between the pc and the arduino just for initial testing? For testing of the rf device do you just want to see the outpt of the rf device in the serial monitor? If so, then try connecting the tx of the rf receiver to the tx pin on the arduino, probably thru a diode with the band end connected to the rf tx pin. The below link has my thoughts on arduino TTL that might be of interest.
http://forum.arduino.cc/index.php?topic=233906.msg1684842#msg1684842
if your problem is cleared can you send the code??
vijith:
if your problem is cleared can you send the code??
This Thread is 3 years dead. Don't hold your breath.
Better to start your own Thread and explain what you need help with.
...R