Y
Y
YARiK_9972014-01-10 01:08:30
Arduino
YARiK_997, 2014-01-10 01:08:30

How to overcome "In file included from sketch_jan09a.ino:1" error when compiling a program for Arduino?

Hello.
When compiling the program, I get this error:
In file included from sketch_jan09a.ino:1:
C:\Users\Yarik\Documents\Arduino\libraries\MeetAndroid/MeetAndroid.h:104: error: conflicting return type specified for ' virtual void MeetAndroid::write(uint8_t)'
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
This is there must be a machine that is controlled by an accelerometer.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
nochkin, 2014-01-10
@nochkin

It would be cool to look at the code itself, which is compiled, so as not to guess.
But if you try to enable telepathic capabilities (and they are weak for me), but perhaps the code uses write, which is already defined elsewhere.
If this is the same function in terms of functionality, then you just need to remove it from your code and use the built-in one.
You can also update the MeetAndroid library to a newer one that is compatible with the latest version of the Arduino IDE.

Y
YARiK_997, 2014-01-10
@YARiK_997

Here is the sketch:

#include <MeetAndroid.h>

const int EnablePin1 = 3;
 const int EnablePin2 = 6;
 const int Motor_1_A = 2;
 const int Motor_1_B = 4;
 const int Motor_2_A = 5;
 const int Motor_2_B = 7;
 float data[3] = {0};
 int intdata[3] = {0};
 int i = 1;


 MeetAndroid meetAndroid(error);

 void error(uint8_t flag, uint8_t values)
 {
   Serial.print("ERROR: ");
   Serial.print(flag);
 }


   void setup() {
   Serial.begin(9600);
   Serial.println("\t\t\t.----------------------.");
   Serial.println("\t\t\t|    Starting Up..     |");
   Serial.println("\t\t\t'----------------------'");
   pinMode(EnablePin1, OUTPUT);
   pinMode(EnablePin2, OUTPUT);
   pinMode(Motor_1_A, OUTPUT);
   pinMode(Motor_1_B, OUTPUT);
   pinMode(Motor_2_A, OUTPUT);
   pinMode(Motor_2_B, OUTPUT);
   delay(1000); 
  
  
   meetAndroid.registerFunction(floatValues, 'A'); 


 }

 void loop()
 {
   meetAndroid.receive(); 
 }
 void floatValues(byte flag, byte numOfValues)
 {
  
   meetAndroid.getFloatValues(data);
  
   for (int i=0; i<3;i++)
   {
     meetAndroid.send(data[i]);
   }
  
       if (-10 <= data[0] && data[0] <= 10) //        This is for Forward/Reverse
       {

         intdata[0] = int(data[0]);
         intdata[0] = intdata[0] * 24;
             if (data[0] <= -2)
             {
               intdata[0] = abs(intdata[0]);
               digitalWrite(Motor_1_A, HIGH);
               digitalWrite(Motor_2_A, HIGH);
               digitalWrite(Motor_1_B, LOW);
               digitalWrite(Motor_2_B, LOW);
               analogWrite(EnablePin1, intdata[0]);
               analogWrite(EnablePin2, intdata[0]);
             }
             else if (data[0] >= 2)
             {
               digitalWrite(Motor_1_A, LOW);
               digitalWrite(Motor_2_A, LOW);
               digitalWrite(Motor_1_B, HIGH);
               digitalWrite(Motor_2_B, HIGH);
               analogWrite(EnablePin1, intdata[0]);
               analogWrite(EnablePin2, intdata[0]);
             }  
             else if (-1 <= data[0] && data[0] <= 1)
             {
               digitalWrite(Motor_1_A, LOW);
               digitalWrite(Motor_2_A, LOW);
               digitalWrite(Motor_1_B, LOW);
               digitalWrite(Motor_2_B, LOW);
               digitalWrite(EnablePin1, LOW);
               digitalWrite(EnablePin2, LOW);
             } 
       }


     if (-10 <= data[1] && data[1] <= 10)  //        This is for Turn Left/Turn Right
     {
                 if (data[1] <= -2)
                 {
                   digitalWrite(Motor_1_A, HIGH);
                   digitalWrite(Motor_2_B, HIGH);
                   digitalWrite(Motor_1_B, LOW);
                   digitalWrite(Motor_2_A, LOW);
                   analogWrite(EnablePin1, intdata[0]);
               analogWrite(EnablePin2, intdata[0]);
                 }
                 else if (data[1] >= 2)
                 {
                   digitalWrite(Motor_1_A, LOW);
                   digitalWrite(Motor_2_B, LOW);
                   digitalWrite(Motor_1_B, HIGH);
                   digitalWrite(Motor_2_A, HIGH);
                   analogWrite(EnablePin1, intdata[0]);
                   analogWrite(EnablePin2, intdata[0]);
                 }
                 else if (-1 <= data[1] && data[1] <= 1)
                 {
                   digitalWrite(Motor_1_A, LOW);
                   digitalWrite(Motor_2_A, LOW);
                   digitalWrite(Motor_1_B, LOW);
                   digitalWrite(Motor_2_B, LOW);
                   digitalWrite(EnablePin1, LOW);
                   digitalWrite(EnablePin2, LOW);
                 }    
     }
 }

A
avstepanov, 2014-01-14
@avstepanov

MeetAndroid.h - where did you get this library from? The curse goes to her

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question