These are the errors when compiling ino 28 on the arduino uno/mega:

sketch_mar24a:254: error: variable or field 'sendServoEvent' declared void
sketch_mar24a:254: error: 'servo_type' was not declared in this scope
sketch_mar24a:254: error: 's' was not declared in this scope
sketch_mar24a:254: error: expected primary-expression before 'int'
sketch_mar24a.ino: In function 'void loop()':
sketch_mar24a:655: error: 'sendServoEvent' was not declared in this scope
sketch_mar24a:987: error: 'sendServoEvent' was not declared in this scope
sketch_mar24a:1000: error: 'sendServoEvent' was not declared in this scope

Thanks GroG

I asked Mastablasta to make this post to be able to see the error, since I can't reproduce it.

/Mats

GroG

8 years 8 months ago

In reply to by Mats

Hi Mats,
The line you commented out here 

https://github.com/MyRobotLab/myrobotlab/blob/develop/src/resource/Ardu…

is a C prototype for the method here

https://github.com/MyRobotLab/myrobotlab/blob/develop/src/resource/Ardu…

In most C code, if a method is used before it is defined, it needs to have a prototype.  This lets the C pre-processor know "Hey, there's going to be references to this method in the below code .. don't worry about it.. we will define it completely in a little while"

I don't know, but I'm going to assume that you have a later version of the IDE, and Mastablasta has an older version.  So the pre-processor in your Arduino IDE might be "smarter"

But I'm going to uncomment it.  I don't understand why you commented it out ..  were you trying to clean things up a little ?

 

the MRLComm version on the Java side is defined in ArduinoMsgCodec

Hi Grog

I got a problem similar to the problem Mastablasta has now. At one point I had tree different definitions of sendServoEvent. So my first test was to comment out the C prototype. That didn't help, because the real problem was that I had copied the sendServoEvent so that exactly the same definitions of it existed twice. When I removed the duplicated code, the compiler worked, so I didn't put the prototype back. Since it seems like the prototype is neccesary for older versions of the IDE, it's reasonable to put it back in again. 

Thanks for helping me. 

/Mats 

  

Mastablasta

8 years 8 months ago

In reply to by Mats

Compiling the ino 28 on Arduino IDE 1.6.8 did not work, using IDE 1.0.5 no problems. You are right Mats.

Arduino: 1.6.8 (Windows 10), Board: "Arduino/Genuino Uno"

Sketch uses 11,746 bytes (36%) of program storage space. Maximum is 32,256 bytes.
Global variables use 1,604 bytes (78%) of dynamic memory, leaving 444 bytes for local variables. Maximum is 2,048 bytes.
Low memory available, stability problems may occur.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x51
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x98
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xe6
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x18
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x06
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x06
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x98
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe6
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x18
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x06

 

This part is from the compile:

---------------------------------------------------------------------

Sketch uses 11,746 bytes (36%) of program storage space. Maximum is 32,256 bytes.

Global variables use 1,604 bytes (78%) of dynamic memory, leaving 444 bytes for local variables. Maximum is 2,048 bytes.

Low memory available, stability problems may occur.

----------------------------------------------------------------

I get the same warnings, but it still works. This is not a problem.

The rest of the messages are from loading the sketch to the Ardino. 

Please check that you have selected the correct board, port and programmer in the tools meny.

I use ArduinoISP as programmer. 

/Mats

Thanks Jens,

This is not a compiling problem,  

as Mats stated - this usually happens when the wrong board is selected on the upload.

Heh, the 444 byte thingy is just a warning...

Its a Arduino IDE issue not a MRLComm one (I think)