Hi, thank you for those of you who answered me earlier. Now, I want to know how to make Servo library work with VirtualWire, or RadioHead Library without needs of processors. Thank You
---Older Messages---
Hi,
I think everything works fine but it said error compiling, could you please help me solve this? Thank You!
#include <VirtualWire.h>
//declaration of integers
int valUp = 0;
int valForward = 0;
int valSide = 0;
int valGForward =0;
int valGSide = 0;
int valWL=0;
int valWR=0;
int WL =8;
int WR=7;
int sideServo = 12;
int upServo = 11;
int downServo = 10;
int forwardServo =9;
#include <Servo.h>
Servo Side, Up, Down, Forward;
void setup() {
// put your setup code here, to run once:
vw_setup(2000);
vw_set_rx_pin(1);
vw_rx_start();
Serial.begin(9600);
Side.attach(sideServo);
Up.attach(upServo);
Down.attach(downServo);
Forward.attach(forwardServo);
pinMode(WL, OUTPUT);
pinMode(WR,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
uint8_t buflen = VW_MAX_MESSAGE_LEN;
uint8_t buf[buflen];
vw_wait_rx();
vw_get_message(buf, &buflen);
if (buf[1] == '
Servo/avr/Servo.cpp.o: In function __vector_17': /Applications/Arduino.app/Contents/Java/libraries/Servo/src/avr/Servo.cpp:81: multiple definition of
__vector_17'
VirtualWire/VirtualWire.cpp.o:/Users/Suphanat/Documents/Arduino/libraries/VirtualWire/VirtualWire.cpp:591: first defined here
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/bin/ld: Disabling relaxation: it will not work with multiple definitions
collect2: error: ld returned 1 exit status
Error compiling.
[/code]);
{
vw_wait_rx();
vw_get_message(buf, &buflen);
int valUp = map (buf[1], 0, 9, 60, 180);
vw_wait_rx();
vw_get_message(buf, &buflen);
int valForward = map (buf[1], 0, 9, 60, 180);
vw_wait_rx();
vw_get_message(buf, &buflen);
int valSide = map (buf[1], 0, 9, 60, 180);
vw_wait_rx();
vw_get_message(buf, &buflen);
int valGForward = map (buf[1], 0, 9, 60, 180);
vw_wait_rx();
vw_get_message(buf, &buflen);
int valGSide = buf[1];
int valWL=0;
int valWR=0;
if (valGSide == 5)
{
valWL= 9;
valWR= 9;
}
else if (valGSide <5)
{
valWR =9;
valWL = 9-(valGSide2);
}
else if (valGSide >5)
{
valWL =9;
valWR = 9-(valGSide2);
}
else
{
valWL = 0;
valWR = 0;
}
valWL = map (valWL,0,9,0,255);
valWR = map (valWR,0,9,0,255);
Side.write(valSide);
Up.write(valUp);
Down.write(valUp);
Forward.write(valForward);
digitalWrite(WL, valWL);
digitalWrite(WR, valWR);
}
}
Servo/avr/Servo.cpp.o: In function `__vector_17':
/Applications/Arduino.app/Contents/Java/libraries/Servo/src/avr/Servo.cpp:81: multiple definition of `__vector_17'
VirtualWire/VirtualWire.cpp.o:/Users/Suphanat/Documents/Arduino/libraries/VirtualWire/VirtualWire.cpp:591: first defined here
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/bin/ld: Disabling relaxation: it will not work with multiple definitions
collect2: error: ld returned 1 exit status
Error compiling.
[/code]