Go Down

Topic: utilisation arduino Due (Read 621 times) previous topic - next topic

powergravity

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
Life Is Like Riding a Motorcycle. To Keep Your Balance You Must Keep Moving...

hirschmensch

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. :) But generally not.

powergravity

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
Life Is Like Riding a Motorcycle. To Keep Your Balance You Must Keep Moving...

hirschmensch

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: http://forum.arduino.cc/index.php?topic=136126.0

weird_dave

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.

powergravity

#5
Jan 29, 2017, 10:14 am Last Edit: Jan 29, 2017, 10:14 am by powergravity
Hello,

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

Quote
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:
- a GPS.
- an IMU,
- two wheel speed sensors. I did an interface circuit.
- a rotary hall effect sensor to measure the steering angle.
- a SD board


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

 
Life Is Like Riding a Motorcycle. To Keep Your Balance You Must Keep Moving...

powergravity

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:
Code: [Select]

#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
Life Is Like Riding a Motorcycle. To Keep Your Balance You Must Keep Moving...

nitrof

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

powergravity

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

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


Thanks again,
Pm
Life Is Like Riding a Motorcycle. To Keep Your Balance You Must Keep Moving...

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy