utilisation arduino Due

Hello,

Sorry if my question seems to be stupid. Can we use the libraries of the other arduino (Mega, Uno,....) with the arduino Due?

Thank you,
Pm

It depends, but generally not, no. That's because the Due is working with a completely different Processor which needs completely different instructions. Well not COMPLETELY different, so some things might work on both. :slight_smile: But generally not.

Thank you for your reactivity.

I am working on a data logger project for motorcycle so I need to use the real time tools. I am curently using a Mega and I was thinking to switch for a due which seems to have great performance.

I am a beginner in Arduino programming and I manage to developp my project by finding similar examples which I adapt for my own application.

So I guess I will find less example for the due and regarding my programming skills it will be to hard...

Thank you,
Pm

Well I don't know if this is what you are looking for but here's a library for the real time clock on the Due: Arduino Due RTC Library - Arduino Due - Arduino Forum

The code gets compiled for the processor you're running, so a lot of the code libraries will work unless they use very specific features of the processor. The main difference is the I/O voltage being 3v3 instead of 5v.
If you can tell us what hardware you're attaching and what libraries you are using we can work out if it will work.

Hello,

Sorry I missed your answers, I have some problems to active the alerts.

If you can tell us what hardware you're attaching and what libraries you are using we can work out if it will work.

The motorcycle data logger (code here) includes:

And actually an Arduino Mega but trying to log at 100 Hz I have some problems that is the reason why I am thinking to upgrade for a Due. Moreover it will let me more freedom to do computations...

According to the sensors, IMU, wheel speed and steering sensors are not a problem but I am sceptic about the GPS. I am using the NeoGPS library which works perfectly but I don't know if I could use it on the due?

Thank you very much and have a good weekend,
Pm

Hello,

I have some problems about the use of the Adafruit_BNO055 library with the IMU BNO055 shield whose the I2C address is not detected.

I would like to use this library because I use specific functions included in this last one.
I tried with the NineAxesMotion library which also works for this shield and no problem.

I saw that specific code is used for the due in the NineAxisMotion library:

#if defined(ARDUINO_SAM_DUE)
#define I2C				Wire1	//Define which I2C bus is used. Wire1 for the Arduino Due
#else
#define I2C             Wire    //Or Wire
#endif

I think it is due to the two I2C bus present on the Due?

I tested to merge the code of the two libraries but no way to get something.
I am a little bit lost...

Is there someone who has ever worked with an Arduino Due and the Adafruit_BNO055 library?

Thank you in advance,
Pm

You can often refer to the DUE DUE pinout diagra..

Im not sure but if you call I2C, it use SDA and SLC on pin 20-21, and if you call I2C2, it use SDA1 and SLC1.

to test your device. use this I2cScanner.

Regards.

Nitrof

Thank you for your answer. :slight_smile:
Finally I found a solution. In the futur if someone has the same issue, add in Adafruit_BNO055.h:

#if defined(ARDUINO_SAM_DUE)
#define Wire		Wire1	//Define which I2C bus is used. Wire1 for the Arduino Due
#endif

Thanks again,
Pm