Go Down

Topic: Clean, straight-forward MPU-6050 code (Read 9 times) previous topic - next topic

Krodal

Are you sure you are using version 1.0.3 ?
I seems you have a version older than 1.0.
Perhaps you can install it again.

Which board are you using, "Due" or "Uno" or "Duemilanove".

I don't have a "Due" myself, but I could at least make the compiler run.
I have tested 1.0.3 with the "Uno" once again, and it compiles but has a lot warnings. I have to fix that someday.

dhenry

Quote
it too is ridiculously long.


That particular piece of code is actually well written. It's well structured and well commented. In particular, the use of all the defines helps make the code more portable and more readable / maintainable. That's how one is supposed to have written code pieces in C - I would have put it in a .c/.h file for that's for another discussion.

The actual code being executed are towards the bottom, if you wish to live with magic numbers - a very bad way of programming.

The device is i2c, so it can be easily coded as such. A 15 minute job,  max, if you want to roll your own.

Krodal

dhenry,
I wanted just one single sketch to get started as quick as possible. A seperate *.h file is better programming.

Do you mean the error codes with the "magic numbers" ?
I can live with that, but perhaps I should make them defines also.

GaryWilkerson

Krodal,

Sorry I misspoke, I'm using a UNO and as I understand it the 1.0.3 IDE, that's what it says at the top of the IDE application.  I've provided a screenshot.  The compile error I'm getting is when I Verify the sketch.

Again thanks for your help, this is confusing

Krodal

I can't replicate that.
Did you change the default libraries ? Or install an other "Wire" library ?
Did you change the sketch ?

I still think you have the libraries of an old version.

Perhaps you should delete all the Arduino software (not your sketches, not your own libraries).
Can you download the Arduino software again, and place it in a new folder, and start it from that new folder.

Go Up