Go Down

Topic: ArduinoRobot.h and Wire.h (Read 1 time) previous topic - next topic

kihon38

Hello,

I´m trying to compile a project with theses tow libraries <ArduinoRobot.h> and <Wire.h> but doesn,t work. I don´t know if there is any incompability with these libraries.

Thanks in advance.
Angel

TomGeorge

Hi, how does it not work, compilation error or after upload an output problem?
What version of adruino IDE are you using?

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

kihon38

Hi, my IDE version is 1.5.4 and when i try to use both libraries I have a lot of errors in the compilation. I have done many test and only writing #include <ArduinoRobot.h> and #include<Wire.h> the project give me errors. If I delete one of them (Robot or wire) and its code the proyect works.
Thanks.

kihon38

Hi, today I´ve been another test and also I have the same problem. In this case I used <ArduinoRobot.h> and <Sevo.h> a"Impossible to complie. this is the error:

avr\Servo.cpp.o: In function `__vector_17':
D:\Arduino\libraries\Servo\arch\avr/Servo.cpp:78: multiple definition of `__vector_17'
avr\Melody.cpp.o:D:\Arduino\libraries\Robot_Control\arch\avr/Melody.cpp:7: first defined here


Angel.

TomGeorge

Hi can you post your code using the code tags and we will see if there is a conflict, how have you developed this sketch, a part at a time or tried to write it all at once.

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

The ArduinoRobot.h library already includes the wire library: http://arduino.cc/en/Reference/RobotLibrary
www.bajdi.com

kihon38

hi, this is the code, it is very simple because I have the robot one week ago.

#include <ArduinoRobot.h>
#include <Servo.h>

int trigger = D3;
int echo = D5;
double distance;


void setup() {
    Robot.begin();
    //Serial.begin(9600);
    pinMode(trigger,OUTPUT);
    pinMode(echo,INPUT);
}

void loop() {
   Robot.motorsWrite(100,100);
   Robot.digitalWrite(trigger, LOW);
   delayMicroseconds(2);
   Robot.digitalWrite(trigger, HIGH);
   delayMicroseconds(5);
   Robot.digitalWrite(trigger, LOW);
   distance=pulseIn(echo,HIGH);
   distance=(distance/29)/2;
   //Serial.println(distance);
   if (distance<30)Robot.motorsStop();
   else Robot.motorsWrite(100,100);
      delay(100);
}

When I delete the Servo library I can compile.

Thankss  :)

Angel

TomGeorge

Hi Angel, I think
Code: [Select]
int trigger = D3;
int echo = D5;

should be
Code: [Select]
int trigger = 3;
int echo = 5;


I don't have the arduinorobot library for some reason, so when I get it I'll try and get it to compile.

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

hockwei

Hi guys:

I needed to assess the I2C pins on the Arduino robot control board, from the website (http://arduino.cc/en/Reference/RobotLibrary ) I understand that the "Wire" library is already included in the arduinoRobot.h. But the problem is what are the equivalent commands? e.g. what is the equivalent of "Wire.requestFrom(2, 6)"?

Appreciate if anyone could give me some guidance.

Best Wishes,
Sean

Go Up