2
\$\begingroup\$

I downloaded the Razor IMU source code last night from Razor AHRS. This code uses exactly the sensors I need and would solve the problem I have currently (I hope). The only problem is that on line 535 in "Razor AHRS v1.4.1\Arduino\Razor_AHRS\Razor_AHRS.pde" in the above linked zip file they have:

Serial.write(id, 2);

When I Verify, compilation fails at this line with the following error:

no matching function for call to 'Serial_::write(byte [2],int)'

I downloaded and installed Arduino 1.0.2 on a new pc and installed the drivers to Arduino Pro Micro 16MHz/5V.

I checked the arduino documentation on Serial.write and it seems to be a valid command.

On a previous machine I had Ardiono 1.0 installed where I initially had this problem. I then installed Arduino 1.0.2 on that machine and it worked. Now, on this new machine I installed 1.0.2 only and it doesn't work.

What am I doing wrong?

asked Nov 26, 2012 at 10:01
\$\endgroup\$
1
  • \$\begingroup\$ @Leon Heller: I noticed that there were tags for Arduino, Serial and IMU which I linked too. I figure at least some other might understand that this is to do with getting my electronic design to work. \$\endgroup\$ Commented Dec 1, 2012 at 8:38

3 Answers 3

2
\$\begingroup\$

According to the Arduino.cc page on Serial.Write, it does support 2 arguments, where the first argument should be an array name (or a pointer to an array, which is the same thing) and the second argument should contain number of items you wish to transmit over the serial link. Line 535 of the Razor_AHRS.pde file you linked to does conform to that specification and should not cause a compile error.

I installed the latest Arduino IDE (1.0.2) and after uncommenting a single line to select hardware the code that you linked to compiled successfully. Looking at the Arduino Changes website it looks like Serial.write(buf,len) was introduced in version 0016.

Please verify that you have a new(ly) version of the Arduino IDE and then update your original post with the error message you are getting. (Altough the Arduino IDE has, at least historically, been rather bad at giving descriptive error messages, in my opionin.)

answered Nov 26, 2012 at 11:35
\$\endgroup\$
1
  • \$\begingroup\$ I've updated my original question, with a new twist. \$\endgroup\$ Commented Nov 30, 2012 at 15:38
1
\$\begingroup\$

Maybe their code was developed on one of the older Arduino IDEs. The function interfaces have changed quite a bit from the 00x releases to Arduino 1.0 and later. Try downloading and using one of the older releases; 0023 has worked for me in many cases.

[moderator's note: This answer had arrived to this thread as a result of a merge.]

Nick Alexeev
38.9k17 gold badges104 silver badges248 bronze badges
answered Dec 1, 2012 at 11:17
\$\endgroup\$
0
\$\begingroup\$

Serial.write((uint8_t *)DataArrayL, (size_t) sizeof(DataArrayL));

use this format

DataArrayL is your name of the array just replace it

answered Aug 20, 2013 at 14:28
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.