Compiling ArduIMU sketch with Arduino 1.0.3

Anyone who uses ArduIMU and tried to upgrade Arduino from 0022 to the current version (anything past 1.0)  discovered that good old firmware that was compiling just fine in the previous versions now throws all kinds of errors.  After doing a quick search on the forum you discover that the official version is that "we don't support V1.0" for the IMU.  Anyhow, just like many others here I just went back to the good old 0022 and forgot about that issue for a while.  Until recently.  I needed to check TX buffer of my UART if it is empty or not.  Turns out there is no such functionality in 0022 but in 1.0 and later Serial.flush() does just that.  So I was back to the same problem - trying to compile my sketch on 1.0

Long story short, it seems to work now.  I haven't had a chance to test the software yet but at least it compiled.

Here are the steps:

1. Install the new Arduino (Current version 1.0.3)

2  Copy old library folders from old Arduino install folder to the new one.  The libraries you are going to need are AP_GPS, AP_Math, AP_Compass and FastSerial. 

3.  Open Arduino 1.0 (or restart it if you already had it opened) and open your ArduIMU sketch.  You should see these libraries in the list of libraries used by Arduino.

4.  Go to the HMC5883 tab and replace all instances of Wire.send to Wire.write and Wire.receive to Wire.read

5.Go to your FastSerial folder (the one you copied to the Arduino library folder.  Open file FastSerial.h in your favorite text editor and change the line virtual void write(unit8_t c); to virtual size_t write(unit8_t c);  Save the file

6. Open FastSerial.cpp and change void FastSerial::Write(unit8_t c) to size_t FastSerial::Write(unit8_t c)  A couple of lines below in the same function change return; to return 0; and at the bottom of the function right before the bracket add return i;

7. In the same file (FastSerial.cpp) go back to the top and change #include "WProgram.h" to #include "Arduino.h"    Save the file and close.  Now go through all the library folders which you added (AP_GPS, AP_Math, AP_Compass)  Open every *.cpp file in every folder and do the same thing (change WProgram.h to Arduino.h) with the exception of APM_Compass.cpp

8.  Open APM_Compass.cpp  delete #include "WProgram.h" and add #include "Arduino.h" before  extern "C" {

9. Now parse through the text of the file (APM_Compass.cpp) and repeat step 4 (find and replace all instances  of Wire.send to Wire.write and Wire.receive to Wire.read

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I went back and replaced "Arduino.h" with <Arduino.h> and it compiles.  Thanks for posting the solution to FastSerial.h

  • Can you tell me at what rate are you getting your readings?

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @knightsautoteam: Hi @diyrobocars, we are Orlando's first Autonomous racing club and would love your support. We are hosting our first K…
yesterday
DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #14 - #ParkingLotNerds join us January 15th for #AutonomousRacing #RoboRace ⁦@DAVGtec…
Monday
DIY Robocars via Twitter
RT @chr1sa: And after that came our races, 50 in all. This battle between these two Russians was the best we've ever seen -- incredible fig…
Monday
DIY Robocars via Twitter
RT @chr1sa: Before our @DIYRobocars virtual race this weekend, we had a presentation from the team that won the Indy Autonomous Challenge i…
Monday
DIY Drones via Twitter
Dec 12, 2021
DIY Robocars via Twitter
Dec 12, 2021
DIY Robocars via Twitter
RT @chr1sa: Just a week to go before our next @DIYRobocars race at @circuitlaunch, complete with famous Brazilian BBQ. It's free, fun for k…
Dec 4, 2021
DIY Robocars via Twitter
How to use the new @donkey_car graphical UI to edit driving data for better training https://www.youtube.com/watch?v=J5-zHNeNebQ
Nov 28, 2021
DIY Robocars via Twitter
RT @SmallpixelCar: Wrote a program to find the light positions at @circuitlaunch. Here is the hypothesis of the light locations updating ba…
Nov 26, 2021
DIY Robocars via Twitter
RT @SmallpixelCar: Broke my @HokuyoUsa Lidar today. Luckily the non-cone localization, based on @a1k0n LightSLAM idea, works. It will help…
Nov 25, 2021
DIY Robocars via Twitter
@gclue_akira CC @NVIDIAEmbedded
Nov 23, 2021
DIY Robocars via Twitter
RT @luxonis: OAK-D PoE Autonomous Vehicle (Courtesy of zonyl in our Discord: https://discord.gg/EPsZHkg9Nx) https://t.co/PNDewvJdrb
Nov 23, 2021
DIY Robocars via Twitter
RT @f1tenth: It is getting dark and rainy on the F1TENTH racetrack in the @LGSVLSimulator. Testing out the new flood lights for the racetra…
Nov 23, 2021
DIY Robocars via Twitter
RT @JoeSpeeds: Live Now! Alex of @IndyAChallenge winning @TU_Muenchen team talking about their racing strategy and open source @OpenRobotic…
Nov 20, 2021
DIY Robocars via Twitter
RT @DAVGtech: Live NOW! Alexander Wischnewski of Indy Autonomous Challenge winning TUM team talking racing @diyrobocars @Heavy02011 @Ottawa…
Nov 20, 2021
DIY Robocars via Twitter
Incredible training performance with Donkeycar https://www.youtube.com/watch?v=9yy7ASttw04
Nov 9, 2021
More…