Hi i am new here , looking forward to help and be helped <3 , still new in the filed of arduino and programming in general
so i am using RH_ASK.h (RadioHead library) whenever i use servo.h with it , its corrupted and give me an error of indicating that there is a variable is being defined again (maybe?).
this is the error
Arduino: 1.8.5 (Windows 8.1), TD: 1.42, Board: "Arduino/Genuino Uno"
libraries\RadioHead\RH_ASK.cpp.o (symbol from plugin): In function `RH_ASK::maxMessageLength()':
(.text+0x0): multiple definition of `__vector_11'
libraries\Servo\avr\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.
i am trying to make two servos work on a joystick module with rf 433hz module.
also i tried just to read the transmitted data and it wasnt alright , the transmission circuit mapping works fine from 0 to 180 but in the receiving circuit it reads from 0 to 31 for x-axis and y-axis is 0 all the time
The Code:
// transmitting
#include<SPI.h>
#include<RH_ASK.h>
RH_ASK d;
void setup() {
Serial.begin(9600);
d.init();
}
void loop() {
uint8_t a[1];
int x = analogRead(A0);
int y = analogRead(A1);
int x0 = map(x , 0 , 1023 , 0 , 180);
int y0 = map(y , 0 , 1023 , 0 , 180);
Serial.println(x0);
Serial.println(y0);
a[0] = (uint8_t) x0;
a[1] = (uint8_t) y0;
d.send( a , 1);
d.waitPacketSent();
}
// recieving
#include<Servo.h>
#include<SPI.h>
#include<RH_ASK.h>
RH_ASK d;
void setup() {
d.init();
Serial.begin(9600);
}
void loop() {
uint8_t b[1];
uint8_t bsize = sizeof(b);
if(d.recv(b , &bsize))
{
int x0 = map(b[0] , 0 , 1023 , 0 , 180);
int y0 = map(b[1] , 0 , 1023 , 0 , 180);
Serial.println(x0);
Serial.println(y0);
}
}
sorry i dont know how to put the code in a neat way xD , nothing really fancy i just wanted to test them out so i can use them with my project
Thank You Very Much for taking your time reading my post <3.