Hi i have been using transmitter and receiver module for ardiuno,I am able to transmit and receive data but the integers that i received are coming in wierd characters in the serial monitor,I have uploaded the code pls tell me whats wrong thanks
//RECEIVER
}
note- i am just using y value of the joystick just to accelerate my dc motar but i havent uploaded my dc motar code as integers are not being able to be received properly, i am pretty sure i have a problem converting the data into bits i think because string values are easily being able to be received and transmitted without error,i have also tried virtual wire but the msgs are not being transmitted in that too.
Here is one way to send an integer value (as binary):
Yval=analogRead(Ypin);
rf_driver.send((uint8_t *)&Yval, 2); //two bytes on AVR Arduino
and receive:
int value=0;
int buflen = 2; // max number of bytes allowed in message
if (driver.recv((uint8_t *) &value, &buflen))
{ if (buflen == 2) //got correct message size?
{ // do something with "value"
its still showing an error #include <RH_ASK.h> // Include RadioHead Amplitude Shift Keying Library #include <SPI.h> // Include dependant SPI Library
RH_ASK rf_driver;
void setup()
{
rf_driver.init();
Serial.begin(9600);
}
void loop()
{
int value=0;
int buflen = 2;
if (rf_driver.recv((uint8_t ) &value, &buflen))
{ if (buflen == 2)
{
Serial.println(value);
}
}
error is- no matching function for call to 'RH_ASK::recv(uint8_t, int*)'