Arduino Forum

Products => Arduino Due => Topic started by: cmaglie on Jan 23, 2013, 09:59 am

Title: Arduino Due libraries (official and 3rd party)
Post by: cmaglie on Jan 23, 2013, 09:59 am
Hi,

if you successfully run a library with the Due board, please post here a link to the library and a brief description.
I'll update this post regularly to get a list of available libraries for the Due.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Markus_L811 on Jan 23, 2013, 10:15 am
First release of the RTC Library for the Arduino Due.

2 examples included.

I would call it final for the moment.

And on github: https://github.com/MarkusLange/Arduino-Due-RTC-Library (https://github.com/MarkusLange/Arduino-Due-RTC-Library)

I hope the library is self explaining.

Markus

Update new library with unixtime and compilertime support

Update Version 1.2 now support for Date & Time in one operation for BKM.

And some changes all in the changelog

Update Version 1.3 now unixtime with timezone support with Example for it, for tevroc

Update Version 1.4 now support for geman timezone with Summertime.

Update Version 1.5 some changes in the Summertime Sketch, and updates at this point only on git

Update Version 1.6 added rtc_clock.timing to detect when the time was set in summer- or wintertime
(mostly helpfully for the german member)

Update Version 1.7 added rtc_clock.date_already_set() to proof if date is allready set, to prevent setting time again for Paul Stoffregen

Update Version 1.8 added rtc_clock.set_clock() to set __Time__,__Date__ in one line fixed bug in unixtime() and summertime() thanks to Paul Stoffregen for the hint
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: randomvibe on Jan 26, 2013, 09:53 am
Eigen is a C++ library enabling Matlab and Octave-like matrix programming.  Eigen works very well with the Arduino Due.  As a Matlab user that appreciates minimalism, the Eigen library is written as plain header files. So no makefiles, no binary files, nothing to compile upfront, no headaches.

To make Eigen available for Arduino-IDE-1.5.2 on Windows 7, please follow these instructions and try my example in step-4: (applies to Due board only)

Step-1:
-> As of 4/16/2013, latest stable release is Eigen 3.1.3
-> Download attached ZIP file called "Eigen313.zip"

Step-2:
-> Copy ZIP file to this precise location in the Arduino IDE directory tree:
   C:\Programs\arduino-1.5.2\hardware\arduino\sam\libraries

Step-3:
-> Run virus scanner, just in case.
-> Unzip to directory in step-2; when done, you should see the following directory:
   C:\Programs\arduino-1.5.2\hardware\arduino\sam\libraries\Eigen313

Step-4:
-> Normally open Arduino-IDE as usual.
-> Run example code below demonstrating the Kalman gain equation using 6x6 matrices. Notice the clean and concise prose enabling programmer to "see" Kalman equations.
-> Also notice the ease in inputting matrices.
-> I wrote a function called print_mtxf to serially print matrices; it's included in the example below.

Good luck.

Code: [Select]
// Example By: RandomVibe
// Eigen Doc: http://eigen.tuxfamily.org/dox/
// Quick Reference: http://eigen.tuxfamily.org/dox/QuickRefPage.html

#include <Eigen313.h>     // Calls main Eigen matrix class library
#include <LU>             // Calls inverse, determinant, LU decomp., etc.
using namespace Eigen;    // Eigen related statement; simplifies syntax for declaration of matrices

void print_mtxf(const Eigen::MatrixXf& K);


void setup() {

   Serial.begin(9600);
   
   // DECLARE MATRICES
   //--------------------
   MatrixXf Pp(6,6);   // Produces 6x6 float matrix class
   MatrixXf H(6,6);    // Note: without "using namespace Eigen", declaration would be: Eigen::MatrixXf H(6,6);
   MatrixXf R(6,6);  
   MatrixXf X(6,6);  
   MatrixXf K(6,6);  
   MatrixXf Z(6,6);  

   // INPUT MATRICES (so-called comma-initialize syntax)
   //---------------------------------------------------------
   Pp << 0.3252,  0.3192,  1.0933, -0.0068, -1.0891, -1.4916,
        -0.7549,  0.3129,  1.1093,  1.5326,  0.0326, -0.7423,
         1.3703, -0.8649, -0.8637, -0.7697,  0.5525, -1.0616,
        -1.7115, -0.0301,  0.0774,  0.3714,  1.1006,  2.3505,
        -0.1022, -0.1649, -1.2141, -0.2256,  1.5442, -0.6156,
        -0.2414,  0.6277, -1.1135,  1.1174,  0.0859,  0.7481 ;

   H << 0.8147, 0.2785, 0.9572, 0.7922, 0.6787, 0.7060,
        0.9058, 0.5469, 0.4854, 0.9595, 0.7577, 0.0318,
        0.1270, 0.9575, 0.8003, 0.6557, 0.7431, 0.2769,
        0.9134, 0.9649, 0.1419, 0.0357, 0.3922, 0.0462,
        0.6324, 0.1576, 0.4218, 0.8491, 0.6555, 0.0971,
        0.0975, 0.9706, 0.9157, 0.9340, 0.1712, 0.8235;

   R << 0.3252,  0.3192,  1.0933, -0.0068, -1.0891, -1.4916,
       -0.7549,  0.3129,  1.1093,  1.5326,  0.0326, -0.7423,
        1.3703, -0.8649, -0.8637, -0.7697,  0.5525, -1.0616,
       -1.7115, -0.0301,  0.0774,  0.3714,  1.1006,  2.3505,
       -0.1022, -0.1649, -1.2141, -0.2256,  1.5442, -0.6156,
       -0.2414,  0.6277, -1.1135,  1.1174,  0.0859,  0.7481;


   // Kalman Gain Example; Matlab form:  K = Pp * H' * inv(H * Pp * H' + R)
   //-----------------------------------
   X  = H * Pp * H.transpose() + R;    
   K  = Pp * H.transpose() * X.inverse();  


   // Print Result
   //----------------------------
    print_mtxf(K);      // Print Matrix Result (passed by reference)
   
}




void loop() {
 // put your main code here, to run repeatedly:
 
}




// PRINT MATRIX (float type)
// By: randomvibe
//-----------------------------
void print_mtxf(const Eigen::MatrixXf& X)  
{
   int i, j, nrow, ncol;
   
   nrow = X.rows();
   ncol = X.cols();

   Serial.print("nrow: "); Serial.println(nrow);
   Serial.print("ncol: "); Serial.println(ncol);      
   Serial.println();
   
   for (i=0; i<nrow; i++)
   {
       for (j=0; j<ncol; j++)
       {
           Serial.print(X(i,j), 6);   // print 6 decimal places
           Serial.print(", ");
       }
       Serial.println();
   }
   Serial.println();
}
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: psgarcha92 on Feb 06, 2013, 01:12 am
the LCDBitmap Library runs flawlessly on the DUE

Located at
http://code.google.com/p/arduino-lcd-bitmap/
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: titous on Feb 08, 2013, 03:54 am
ported basic function over for the adafruit stepper shield (http://www.adafruit.com/products/81)

the library can be downloaded here (http://forums.adafruit.com/viewtopic.php?f=31&t=35617)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Tom Carpenter on Feb 09, 2013, 11:54 am
As mentioned in this thread:
http://arduino.cc/forum/index.php/topic,136495.0.html

My gLCD-Library (https://github.com/TCWORLD/gLCD-Library) for Nokia 6100 Displays fully supports the arduino due. This means that the Sparkfun Color LCD Sheild is compatible with the Due.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: cowasaki on Feb 11, 2013, 12:02 pm
UTFT library thread:

http://arduino.cc/forum/index.php/topic,144198.0.html


SDfat library thread:

http://arduino.cc/forum/index.php/topic,135439.0.html


OneWire library thread:

http://arduino.cc/forum/index.php/topic,141030.0.html


AdaFruit RTC library thread:

http://arduino.cc/forum/index.php/topic,143515.0.html
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: stimmer on Feb 24, 2013, 02:22 pm
Due VGA Library: http://arduino.cc/forum/index.php/topic,150517.0.html

The VGA library lets you connect your Due to a monitor with an analog VGA input. Modes supported include 640x480 and 800x600 in monochrome and 320x240 in colour. Simple drawing functions for pixels, lines, triangles, rectangles, circles and ellipses are included. Full support for Arduino-style print and println functions too.

Schematic is extremely simple - just 3 resistors for monochrome and 10 resistors for colour.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: josheeg on Feb 27, 2013, 02:44 pm
I am using the Eigen library and want to run it in the arduino due I have posted some of my codeblocks c++ code for my windows machine.

Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.

http://eigen.tuxfamily.org/index.php?title=Main_Page

Code: [Select]
#include <iostream>
#include <Eigen/Dense>
#include <Eigen/LU>
using Eigen::MatrixXd;
using namespace std;
int main()
{
cout << "Hello Pattern matching Linear Discriminent Analisis!" << endl;
cout << "" << endl;
cout << "x data" << endl;

//data matrix x row col
MatrixXd x(4,2);
//cur
x(0,0) = 2.95;//g0
x(1,0) = 2.53;
x(2,0) = 3.57;
x(3,0) = 3.16;

//dia
x(0,1) = 6.63;//g0
x(1,1) = 7.79;
x(2,1) = 5.65;
x(3,1) = 5.47;

std::cout << x << std::endl;
cout << "End of x data" << endl;
cout << "" << endl;

cout << "x1 data" << endl;

MatrixXd x1(3,2);

x1(0,0) = 2.58;//g1
x1(1,0) = 2.16;
x1(2,0) = 3.27;

x1(0,1) = 4.46;//g1
x1(1,1) = 6.22;
x1(2,1) = 3.52;

std::cout << x1 << std::endl;
cout << "End of x1 data" << endl;
cout << "" << endl;

//group adv
cout << "x data adverage ui" << endl;

MatrixXd ui(1,2);//group/feature
ui(0,0)=(x(0,0) + x(1,0) + x(2,0) + x(3,0))/4;
ui(0,1)=(x(0,1) + x(1,1) + x(2,1) + x(3,1))/4;
std::cout << ui << std::endl;
cout << "" << endl;

cout << "x1 data adverage ui1" << endl;

MatrixXd ui1(1,2);//group/feature

ui1(0,0)=(x1(0,0) + x1(1,0) + x1(2,0))/3.0;
ui1(0,1)=(x1(0,1) + x1(1,1) + x1(2,1))/3.0;
std::cout << ui1 << std::endl;
cout << "" << endl;

cout << "x & x1 data adverage u" << endl;
MatrixXd u(1,2);//all group/feature
u(0,0)=(x(0,0) + x(1,0) + x(2,0) + x(3,0) + x1(0,0) + x1(1,0) + x1(2,0))/7.0;

u(0,1)=(x(0,1) + x(1,1) + x(2,1) + x(3,1) + x1(0,1) + x1(1,1) + x1(2,1))/7.0;

std::cout << u << std::endl;
cout << "" << endl;


cout << "mean corrected data xig - u" << endl;
MatrixXd ximinu(4,2);
//cur
ximinu(0,0) = x(0,0) - u(0,0);//f0
ximinu(1,0) = x(1,0) - u(0,0);
ximinu(2,0) = x(2,0) - u(0,0);
ximinu(3,0) = x(3,0) - u(0,0);
//dia
ximinu(0,1) = x(0,1) - u(0,1);//f1
ximinu(1,1) = x(1,1) - u(0,1);
ximinu(2,1) = x(2,1) - u(0,1);
ximinu(3,1) = x(3,1) - u(0,1);
std::cout << ximinu << std::endl;
cout << "" << endl;

cout << "mean corrected data xi1 - u" << endl;


MatrixXd ximinu1(3,2);
//cur
ximinu1(0,0) = x1(0,0) - u(0,0);
ximinu1(1,0) = x1(1,0) - u(0,0);
ximinu1(2,0) = x1(2,0) - u(0,0);
//dia
ximinu1(0,1) = x1(0,1) - u(0,1);//g1
ximinu1(1,1) = x1(1,1) - u(0,1);
ximinu1(2,1) = x1(2,1) - u(0,1);

std::cout << ximinu1 << std::endl;

cout << " " << endl;

cout << "Transpose matricies" << endl;
cout << "xi - u T" << endl;

MatrixXd ximinut(4,2);
ximinut= ximinu.transpose();
std::cout << ximinut<< std::endl;
cout << " " << endl;

cout << "xi1 - u T" << endl;
MatrixXd ximinu1t(3,2);
ximinu1t= ximinu1.transpose();
std::cout << ximinu1t << std::endl;
cout << " " << endl;

cout << "Covariance matrix of group ci" << endl;
MatrixXd ci(2,2);
ci = ( ximinut * ximinu ) /4.0;
std::cout << ci << std::endl;
cout << "" << endl;

cout << "Covariance matrix of group ci1" << endl;
MatrixXd ci1(2,2);
ci1 = ( ximinu1t * ximinu1 ) /3.0;
std::cout << ci1 << std::endl;
cout << "" << endl;

cout << "Pooled within group Covariance matrix c" << endl;
MatrixXd c(2,2);
c(0,0) = 4.0/7.0 * ci(0,0) + 3.0/7.0 * ci1(0,0);
c(1,0) = 4.0/7.0 * ci(1,0) + 3.0/7.0 * ci1(1,0);
c(0,1) = 4.0/7.0 * ci(0,1) + 3.0/7.0 * ci1(0,1);
c(1,1) = 4.0/7.0 * ci(1,1) + 3.0/7.0 * ci1(1,1);
std::cout << c << std::endl;
cout << "" << endl;

cout << "inverse of Pooled within group Covariance matrix cinverse" << endl;
MatrixXd cinverse(2,2);
cinverse=c.inverse();
std::cout << cinverse << std::endl;
cout << "" << endl;

cout << "Probability of a group" << endl;
cout << "x = 4/7 x1 = 3/7" << endl;

//create a vector of a probability...
cout << "" << endl;

//formula for calculatin likelyhood of data in a group...
//fi = uig cinverse xkt - 1/2uig cinverse uitg + ln probability

cout << "End of program!" << endl;

    return 0;
}
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: rbqaa on Mar 01, 2013, 01:21 am
Library for WS2803 LED driver chips.

https://github.com/JamesRMartin/WS2803Due (https://github.com/JamesRMartin/WS2803Due)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: jake1981 on Mar 01, 2013, 04:31 pm
DS1307 RTC library: http://arduino.cc/forum/index.php/topic,141233.msg1138572.html#msg1138572 (http://arduino.cc/forum/index.php/topic,141233.msg1138572.html#msg1138572)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: cmaglie on Mar 02, 2013, 11:37 am
Library for Due and WiFly GSX Breakout from SparkFun

http://arduino.cc/forum/index.php/topic,151256.msg0.html
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: olikraus on Mar 02, 2013, 10:30 pm
The graphics LCD (ST7565, UC1701, KS0108, ...) and OLED  (SSD1306, ...) library "U8glib" includes support for Arduino Due.

http://code.google.com/p/u8glib/ (http://code.google.com/p/u8glib/) 
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: AndyL on Mar 03, 2013, 07:16 pm
Roving Networks RN-XV library.

Basically this is the one from https://github.com/harlequin-tech/WiFlyHQ (https://github.com/harlequin-tech/WiFlyHQ) but modified to work with Arduino Due is at:

https://bitbucket.org/thiseldo/wiflyhqdue (https://bitbucket.org/thiseldo/wiflyhqdue)

Changes are to remove PSTR and PROGMEM use and to change to hardware serial instead of softserial.

Examples updated.

There may still be issues with this as not fully tested in all situations, but basic client and server actions seem to work.

Full credit to the original authors, Harlequin-tech for their library.

Thanks

Andy
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: LaMega on Mar 06, 2013, 01:25 pm
who knows the link of the IRremote.h for the Due
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: delsauce on Mar 06, 2013, 11:19 pm
I created a simple external memory interface/static memory controller.  Because of some HW limitations, it's not a full bus interface but can be used for interfacing with parallel LCDs.

More info here:
http://arduino.cc/forum/index.php/topic,152644.0.html (http://arduino.cc/forum/index.php/topic,152644.0.html)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ecopoesis on Mar 07, 2013, 09:06 pm
ported Adafruit's sensor framework and TSL2561 (luminosity sensor) lib to the Due:

https://github.com/ecopoesis/Adafruit_Sensor
https://github.com/ecopoesis/Adafruit_TSL2561
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: dewy721 on Mar 09, 2013, 01:09 am
The AccelStepper library (http://www.open.com.au/mikem/arduino/AccelStepper/) works beautifully with the Due. (Using step/dir based driver board.)

Desc:
High performance Non-Blocking (or blocking if desired).
Stepper library written in C++

Developmental Assets:
Very well documented.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: randomvibe on Mar 09, 2013, 10:03 am
Library:  pwm01.h
Description:  A clean alternate approach for setting up unique PWM frequencies from within a sketch, for any or all PWM pins.  The trick is to utilize the two PWM clocks (CLKA & CLKB) provided by the SAM3X8E chip.

I wrote and enclosed a library (pwm01.h).  It includes 4 user functions to:  1) setup PWM resolution, 2) setup PWM pin, frequency & pick clock, 3) write duty cycle, and 4) stop PWM.  See example code for usage:

Code: [Select]
#include "C:\Programs\arduino-1.5.1r2\hardware\arduino\sam\libraries\Pwm01\pwm01.h"

void setup()
{
   uint32_t  pwm_duty = 32767;
   uint32_t  pwm_freq1 = 2;  
   uint32_t  pwm_freq2 = 5000;

   // Set PWM Resolution
   pwm_set_resolution(16);  

   // Setup PWM Once (Up to two unique frequencies allowed
   //-----------------------------------------------------    
   pwm_setup( 6, pwm_freq1, 1);  // Pin 6 freq set to "pwm_freq1" on clock A
   pwm_setup( 7, pwm_freq2, 2);  // Pin 7 freq set to "pwm_freq2" on clock B
   pwm_setup( 8, pwm_freq2, 2);  // Pin 8 freq set to "pwm_freq2" on clock B
   pwm_setup( 9, pwm_freq2, 2);  // Pin 9 freq set to "pwm_freq2" on clock B
     
   // Write PWM Duty Cycle Anytime After PWM Setup
   //-----------------------------------------------------    
   pwm_write_duty( 6, pwm_duty );  // 50% duty cycle on Pin 6
   pwm_write_duty( 7, pwm_duty );  // 50% duty cycle on Pin 7
   pwm_write_duty( 8, pwm_duty );  // 50% duty cycle on Pin 8
   pwm_write_duty( 9, pwm_duty );  // 50% duty cycle on Pin 9

   delay(30000);  // 30sec Delay; PWM signal will still stream
       
   // Force PWM Stop On All Pins
   //-----------------------------    
   pwm_stop( 6 );
   pwm_stop( 7 );
   pwm_stop( 8 );
   pwm_stop( 9 );
}

void loop()
{  
}



The pwm01.h library and example code were tested in IDE 1.5.1r2.  Additional notes on this library:
- Applies to Arduino-Due board, PWM pins 6, 7, 8 & 9.
- Libary Does not operate on the TIO pins.
- Unique frequencies set via PWM Clock-A ("CLKA") and Clock-B ("CLKB")
 Therefore, up to two unique frequencies allowed.
- Set max duty cycle counts (pwm_max_duty_Ncount) equal to 255 per Arduino approach.  
 This value is best SUITED for low frequency applications (2hz to 40,000hz) such as
 PWM motor drivers, 38khz infrared transmitters, etc.
- Future library versions will address high frequency applications.
- Arduino's "wiring_analog.c" function was very helpful in this effort.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: pjrc on Mar 16, 2013, 12:18 am
Encoder has been updated to support Arduino Due.

http://www.pjrc.com/teensy/td_libs_Encoder.html
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: billroy on Mar 18, 2013, 10:25 pm
Bitlash is confirmed up and running on the Due, thanks to patches submitted by a friendly user.

http://bitlash.net

Regards to all,


-br
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: LaMega on Mar 20, 2013, 01:52 am
ShiftOutMega.h

http://www.4shared.com/get/QSUfwzo4/ShifOutMega.html



DS1307.h

http://www.4shared.com/get/HIZiPup2/DS1307.html
Title: Timer Library for Arduino DUE
Post by: ivanseidel on Mar 30, 2013, 11:11 pm
Hi!
As i like libraries, i have done one for Timers on the Arduino DUE.

You can check it out here: https://github.com/ivanseidel/DueTimer

All 6 timers are fully implemented, and ready to play with...
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: prphntm63 on Apr 01, 2013, 12:04 am
I made a (very basic) library to interface with the FTDI Vdrive2 module. Uses TX1/RX1 for communication with the Vdrive2 and TX0/RX0 to send the responses to the Serial Monitor.

https://github.com/prphntm63/VDRIVE2.git (https://github.com/prphntm63/VDRIVE2.git)

Improvements welcome ;)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: zachtos on Apr 03, 2013, 08:22 pm
I can confirm that the Xbee Library works on DUE.  I ported over my code and tested last night.

http://code.google.com/p/xbee-arduino/ (http://code.google.com/p/xbee-arduino/)
Title: Re: Timer Library for Arduino DUE
Post by: SomeRandomGuy on Apr 05, 2013, 01:48 am

Hi!
As i like libraries, i have done one for Timers on the Arduino DUE.

You can check it out here: https://github.com/ivanseidel/DueTimer

All 6 timers are fully implemented, and ready to play with...


I have merged all the features of my timer library with his. This is a great timer library, and we would love feedback for any features that people would like to see.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: pjrc on Apr 07, 2013, 07:52 pm
The Time library has been updated for compatibility with Arduino Due.

http://playground.arduino.cc/Code/Time

A Due-specific example was added, using Markus Lange's rtc_clock library to access the Due's on-chip RTC.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Kuya Marc on Apr 09, 2013, 04:55 pm

The Time library has been updated for compatibility with Arduino Due.

http://playground.arduino.cc/Code/Time

A Due-specific example was added, using Markus Lange's rtc_clock library to access the Due's on-chip RTC.


What on-chip RTC? I just built a DS1307 project for Arduino Mini; does the Arduino Due have an internal RTC so a chip like DS1307 is not needed?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: pjrc on Apr 10, 2013, 11:24 am

What on-chip RTC?


Due does have an on-chip RTC.  The way the reset signals are wired makes it less useful for many projects, but there is indeed a RTC on the chip.

For more info, please download the new version of the Time library and look at its TimeArduinoDue example.  You'll also need Markus's rtc_clock libary.  Again, see the comments in TimeArduinoDue for more info.
Title: Re: Timer Library for Arduino DUE
Post by: henrimontreal on Apr 11, 2013, 12:36 am

Hi!
As i like libraries, i have done one for Timers on the Arduino DUE.

You can check it out here: https://github.com/ivanseidel/DueTimer

All 6 timers are fully implemented, and ready to play with...



May I ask you how I can use your file? I cannot include any library from out side. Is there anyway to run within one file? I would like to use a timer and change the REG by Serial Monitor.
Title: Re: Timer Library for Arduino DUE
Post by: ivanseidel on Apr 12, 2013, 07:54 am


Hi!
As i like libraries, i have done one for Timers on the Arduino DUE.

You can check it out here: https://github.com/ivanseidel/DueTimer

All 6 timers are fully implemented, and ready to play with...



May I ask you how I can use your file? I cannot include any library from out side. Is there anyway to run within one file? I would like to use a timer and change the REG by Serial Monitor.


Hi,
If you want to include the library to your project, than all you nees to do is to copy DueTimer.h and DueTimer.cpp to your sketch folder and include it normaly (#include "DueTimer.h").
What do you mean by change REG? And might I ask why can't you install the library?
Thanks,
Ivan
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: enternoescape on Apr 16, 2013, 06:58 am
I ported Ken Shirriff's IRremote library to work with the Due with a few improvements:
https://github.com/enternoescape/Arduino-IRremote-Due (https://github.com/enternoescape/Arduino-IRremote-Due)

Note: Don't forget to use a transistor to drive the IR LED. It might work powered directly, but probably not for long. :)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: kemonine on May 10, 2013, 03:12 pm
I updated the RF24 (Nordic nRF24L01+) library to run on the Due.  I ran the basic ping/pong dyn example for testing.

Code: https://github.com/mcrosson/RF24

Edit: You'll need to use the "due" branch from the above repo with the DUE.
Title: [GitHub] Advanced Object Oriented User Interface (ArdUI)
Post by: ivanseidel on May 20, 2013, 02:12 am
Hi!

Finaly, I made the code independent from my own aplications, and could sucessfuly comment EVERY line of code.

What am I talking about?

Well, it's the First, Object Oriented User Interface for Arduino, with an Advanced controller of Touch and Views

https://github.com/ivanseidel/ArdUI/wiki (https://github.com/ivanseidel/ArdUI/wiki)

All based in Events and Callbacks, and also inspired on real Android code, you can easily implement whatever you want with it.

Some key features:
* Touch is handled BOTH in interrupt and Timer
 (Once a touch is triggered on the interrupt, Timer is the one who start trigering the event. Once no touch is detected, controll is passed to the Interrupt)

* Callbacks. Every view has it's own callbacks and events. onClick, onTouch, onChange.

* Touch Events. Like Android, touch events are implemented, such as: ACTION_DOWN, ACTION_UP, ACTION_MOVE, ACTION_HOVER_ENTER, ACTION_HOVER_EXIT

* Views are implemented extending main class View, or other that implements View. Object oriented allows user to extend a class and improve whatever he wants to.
Views already implemented: SeekBar, ProgressBar, Button, CheckBox, TextView and ViewGroup, that allows many views in a single views.

* Tree Rendering: Once a render is triggered, the view start rendering it's own tree. For example:
If you have 5 views inside a ViewGroup, and one of the 5 is also a ViewGroup containing more 10 views, calling a "render()" on the top view of the tree, will start rendering all the views. Also, calling a "render(false)" will start rendering ONLY the "invalidated" views (only what is necessary).

* Relative rendering: If one view is inside the other, it's relative to the other. One position in a view is ALWAYS relative to it's parent. Moving a view that has views inside, cause it's childs to move with it. Rendering, and Touch are handled relative also.

* Changing Between rootViews is very easy (for example, running another function, state,...). Prepare all your views, and then register the current one on ArdUI. He will make the rest...

Documentation is not done yet, and there is a lot to be done (and improved). I'm using it currently on my robots: TendaDigital.net and it seems to be VERY robust and thrustable.

This is the kind of library, that does everything, you just need to know how to use it (Yet, a little complicated, since I'm still documenting).
Title: [gitHub] THREAD and THREADController classes for Arduino
Post by: ivanseidel on May 20, 2013, 02:12 am
Hi,
I always use this library for myself, and I personaly think that is VERY usefull. Its clear that Arduino doesen't support real parallel processes, but we can "sort" of do it with scheduled tasks.

Yes, there is already an class called "Scheduller", but for big projects (likes the ones I do, with more than 15.000 lines), it's not "good" enought...

I LOVE Object Oriented stuff, and this follows it pretty much.

Check out the library here: https://github.com/ivanseidel/ArduinoThread (https://github.com/ivanseidel/ArduinoThread)

It also works for ANY arduino, but I implemented thinking on the DUE, since it's capable of more stuff (I use it with my ArduinOS, and it's just perfect =] )

Any suggestions are welcome!
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: cowasaki on May 20, 2013, 03:22 pm
First version of the DueGUI library is now downloadable...


http://forum.arduino.cc/index.php?topic=164788.0
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: MGOS on May 21, 2013, 02:32 pm
Hey everyone,

I rewrote the T6963 library to interface a graphics LCD using the Toshiba driver with the arduino due.
It is significantly faster than the old version since all data bus lines are on port C of the AT91. All pins used are on the vertical 18*2 pin connector what allows you to use a ribbon cable.
Examples and instructions to hook it up included.

Edit: Fixed bug for UpdateBuff(), speed optimizations
Title: Library for Arduino Due and Sparkfun MP3 shield
Post by: gallegojm on May 29, 2013, 03:16 am
I modify SFEMP3Shield library from Bill Porter and Michael Flaga so that Sparkfun MP3 shield work with Arduino Due.
You can play files from SD memories or listen to web radios.
See http://forum.arduino.cc/index.php?topic=168914.0
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: cowasaki on May 29, 2013, 06:55 am
DueGUI library is now at version 0.13 and with the start of some quite thorough documentation.  All the most important GUI objects are already implemented with more to come.  Why not give it a try:


http://forum.arduino.cc/index.php?topic=164788.0
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: c-agua on May 29, 2013, 07:40 am
DueGUI seems to be very good. is it possible to run on mega?. Is it possible to run on iboard pro?. I am working now on a iboard pro project.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: cowasaki on May 29, 2013, 12:13 pm

DueGUI seems to be very good. is it possible to run on mega?. Is it possible to run on iboard pro?. I am working now on a iboard pro project.


It should do but I will have to look up how do the interrupts on the mega too.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: stecape on May 30, 2013, 09:09 am
Hi guys... Nothing about VirtualWire?

http://www.airspayce.com/mikem/arduino/ (http://www.airspayce.com/mikem/arduino/)

I can't compile with Due... does anybody succeeded?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: kmartburrito on Jun 12, 2013, 11:09 pm
I'm hoping for one for the RFM12 line of wireless modules.  Anyone know if that one has been ported yet?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: exedor on Jun 20, 2013, 05:01 am
I sort of formalized and hopefully simplified randomvibe's original code to run the Due hardware PWM pins 6, 7, 8, and 9 which avoids using slower analogWrite calls.  This was paramount for my application because I'm really pushing the limits of what the Due is capable of.  I'm heavily using nearly every pin on the board and taking advantage of as many of the optimization and hardware features as possible is extremely important.  It's attached...

Title: Re: Arduino Due libraries (official and 3rd party)
Post by: robertkendrick on Jul 03, 2013, 11:19 am

Adafruit ST7735 and GFX libraries modified to run on the Arduino Due here:

http://github.com/robertkendrick/Due_ST7735

regards
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: UnaClocker on Jul 15, 2013, 02:45 am
Where do you feed the battery backup power into the DUE to keep the RTC awake while it's powered down?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Tom Carpenter on Jul 15, 2013, 10:49 am
You can't. They've not only wired the backup power pins to the +3.3V and GND, but also they have not populated the 32kHz crystal so you couldn't use the RTC even with normal power.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: UnaClocker on Jul 20, 2013, 02:52 am
heh, at least, not without lifting the pins off the board and running some crazy jumper wires.. :)
Title: [Published on GitHub] LinkedList Class (Fully implemented)
Post by: ivanseidel on Jul 21, 2013, 02:59 am
Hi folks,

I have published my LinkedList Class on GitHub. It's REALLY usefull for all kinds of libraries and projects.

Features that are implemented:


For more information, and Latest releases go to https://github.com/ivanseidel/LinkedList (https://github.com/ivanseidel/LinkedList)

Fell free to commit new changes and use it.

Ivan
Title: [Published on GitHub] Gaussian Class and Moving Average
Post by: ivanseidel on Jul 21, 2013, 03:08 am
Hi folks,

After a lot of work, I could manage to make a Gaussian "simple" enough to use and implement almos everything.

In this Library summing Gaussians is really easy, like this:

Code: [Select]
Gaussian g1 = Gaussian(10, 30.4);

Gaussian result = g1 + Gaussian(30, 40);


There is also a Moving Average class, called "GaussianAverage". It works great with Gaussians and also simple values.

Code: [Select]
GaussianAverage myAverage(10); // 10 samples to keep track of

myAverage += Gaussian(32, 2.45);
myAverage += 10; // Automaticaly adds a Gaussian with Maximum variance

Gaussian average = myAverage.process();


For more information and a very detailed documentation, go to https://github.com/ivanseidel/Gaussian (https://github.com/ivanseidel/Gaussian)

Fell free to commit new changes and use it.

Ivan
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: rmetzner49 on Jul 28, 2013, 07:23 pm
Ivan, when I use your library and #include your CPP file in my Sketch (.ino), at link time I'm getting multiple definitions of the timer objects.  I have #include DueTimer.cpp at the beginning.  The DueTimer.h is of course included in the CPP file.  How can I ask the preprocessor to only include it once?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ivanseidel on Jul 28, 2013, 08:13 pm

Ivan, when I use your library and #include your CPP file in my Sketch (.ino), at link time I'm getting multiple definitions of the timer objects.  I have #include DueTimer.cpp at the beginning.  The DueTimer.h is of course included in the CPP file.  How can I ask the preprocessor to only include it once?


Hi,
Never include de .cpp file, always include the .h =]
#include <DueTimer.h>
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Madeline on Aug 02, 2013, 07:36 pm
Arduino Due TLC5940 Library

  Information and Download: https://code.google.com/p/arduino-due-tlc5940/ (https://code.google.com/p/arduino-due-tlc5940/)

The Arduino Due uses an ARM Cortex M3 processor made by Atmel (SAM3X8E). This microcontroller is fairly different from the normal AVR microcontrollers used for most Arduinos. Alex Leone made an Arduino library for handling Texas Instrument's TLC5940 16 Channel LED PWM driver with the AVR microcontrollers (https://code.google.com/p/tlc5940arduino/ (https://code.google.com/p/tlc5940arduino/)).

However, running the TLC5940 well requires delving into lower-level parts of the hardware -- things like timer counters and interrupts -- and these are different on the Due/SAM3X8E. I've started a TLC5940 library that makes use of the features offered by the SAM3X8E. At least for now, this library doesn't offer all the fancy features that Alex Leone's library (e.g. animations, fades, PROGMEM storage, etc.) because I didn't need those features. I have my own libraries for describing and running lightshows.

Hopefully some will find this useful.  ;)

- Madeline
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: bjosephs on Aug 03, 2013, 12:57 pm
Hi all,


I 've been working on my senior project - a balancing robot - using a Mega 2560.  A recent accident damaged the board and I was thinking of replacing it with a Due to see if the faster clock speed helped.  Can someone check to see if the following libraries/examples work or at least compile?

These 2 I'm using now:
http://bildr.org/2011/06/l3g4200d-arduino/
http://www.loveelectronics.co.uk/Tutorials/12/adxl345-accelerometer-arduino-tutorial

This one will be my next purchase, I think:
http://bildr.org/2012/03/stable-orientation-digital-imu-6dof-arduino/

It would be greatly appreciated,

Brian
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: pjrc on Aug 06, 2013, 10:27 am

Can someone check to see if the following libraries/examples work or at least compile?


It's pretty easy to just download Arduino 1.5.2, add the library, select Due from Tools > Boards, and click Verify.  No hardware purchase necessary!  (at least to know if it merely compiles)

Just for fun, I tried one of the libraries just now.  ADXL455_Example.pde definitely does not compile.  The first error I hit was it depends on WProgram.h, which Arduino hasn't supported since 0023.  I edited that to Arduino.h, but then it depends on pre-1.0 stuff from the Wire library.  I didn't go any farther.  This probably won't work on ANY Arduino board using any version of Arduino newer than 0023.
Title: Adafruit TFTLCD
Post by: noblepepper on Aug 08, 2013, 07:51 pm
I have posted a patch for the Adafruit TFTLCD library to allow the Due to use LCD displays based on the ILI9825/9828 controllers with a 8 bit parallel interface here:
https://github.com/noblepepper/TFTLCD-for-Arduino-Due
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: peebee on Aug 16, 2013, 10:07 pm
EasyTransfer compiles with this mod to EasyTransfer.h. Just wrap the avr include with an ifndef/endif:

Code: [Select]
#ifndef __SAM3X8E__
#include <avr/io.h>
#endif


PS: Pity it doesn't do retransmits...
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Judgester on Aug 18, 2013, 10:02 pm
Hi Everyone, I am very new to this, have had some success with a few Uno projects and now want to try working with a Due. However there are some libraries that I would like to use that are available for the Uno but not for Due. So the question comes... is there are general guidelines for converting libraries that work with Uno so they will work with Due? For example, Sensirion and BMP085.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Terraluna on Sep 04, 2013, 01:39 am
Hey i am also new here,

may be some one are interested in a due working sketch for the BMP085

Code: [Select]
/***********************************************************************************************
* Sketch:  BMP085_Text.ino
* Author:  A. Kriwanek: http://www.kriwanek.de/arduino/wetterstation.html
* Version: 1.00  01.09.2012/17:15
*
* This sketch tests a BMP085 barometric sensor. Temperature and pressure are read from the sensor
* The mathematical computation is  done and the results will be displayed every second on the
* serial monitor.
*
* Used Hardware:
* - Sparkfun Breakout board BMP085
* - Arduino UNO Protoboard
* - Arduino UNO
*
* My sketch is free software: Arduino BMP085_Text.ino von Andreas Kriwanek steht unter
* einer Creative Commons Namensnennung-Weitergabe unter gleichen Bedingungen 3.0 Unported Lizenz.
*
* My Sketch in wide parts is based on the sketch from Jim Lindblom:
*
* BMP085 Extended Example Code
* by: Jim Lindblom
* SparkFun Electronics
* date: 1/18/11
* license: CC BY-SA v3.0 - http://creativecommons.org/licenses/by-sa/3.0/
*
* Update (7/19/11): I've heard folks may be encountering issues
* with this code, who're running an Arduino at 8MHz. If you're
* using an Arduino Pro 3.3V/8MHz, or the like, you may need to
* increase some of the delays in the bmp085ReadUP and
* bmp085ReadUT functions.
*
* https://www.sparkfun.com/products/9694 Product page
* http://de.wikipedia.org/wiki/Luftdruck Correction formula to sea level
* http://www.meteo24.de/wetter/49X8157.html Weather Bad Aibling
*
**********************************************************************************************/

#include <Wire.h>

#define BMP085_ADDRESS 0x77        // I2C address of BMP085

const unsigned char OSS = 0;       // Oversampling Setting

// Calibration values of BMP085:
short ac1;
short ac2;
short ac3;
unsigned short ac4;
unsigned short ac5;
unsigned short ac6;
short b1;
short b2;
short mb;
short mc;
short md;

// b5 is calculated in bmp085GetTemperature(...), this variable is also used in bmp085GetPressure(...)
// so ...Temperature(...) must be called before ...Pressure(...).
long b5;

float temperature;
float pressure;
float pressureNN;
float pressureCorrection = 0.98731518;  // Höhe 103 ü.NN Halle. Please calculate your coeffizient
                                       // for your homes elevation!

//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------
void setup()
{
 Serial.begin(115200);
 Wire.begin();
 bmp085Calibration();
}

//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------
void loop()
{
 temperature = bmp085GetTemperature(bmp085ReadUT())/10;
 pressure = bmp085GetPressure(bmp085ReadUP())/100;
 pressureNN = pressure / pressureCorrection;
 Serial.print("Temperature: ");
 Serial.print(temperature,1);
 Serial.print(" C, Pressure: ");
 Serial.print(pressure,1);
 Serial.print(" hPa in 103m height above sea level, Pressure-NN: ");
 Serial.print(pressureNN,1);
 Serial.println(" hPa");
 delay(1000);
}

//----------------------------------------------------------------------------------------------------------
// Stores all of the bmp085's calibration values into global variables
// Calibration values are required to calculate temp and pressure
// This function should be called at the beginning of the program
void bmp085Calibration()
{
 ac1 = bmp085ReadInt(0xAA);
 ac2 = bmp085ReadInt(0xAC);
 ac3 = bmp085ReadInt(0xAE);
 ac4 = bmp085ReadInt(0xB0);
 ac5 = bmp085ReadInt(0xB2);
 ac6 = bmp085ReadInt(0xB4);
 b1 = bmp085ReadInt(0xB6);
 b2 = bmp085ReadInt(0xB8);
 mb = bmp085ReadInt(0xBA);
 mc = bmp085ReadInt(0xBC);
 md = bmp085ReadInt(0xBE);
}

//----------------------------------------------------------------------------------------------------------
// Calculate temperature given ut.
// Value returned will be in units of 0.1 deg C
short bmp085GetTemperature(unsigned short ut)
{
 long x1, x2;
 
 x1 = (((long)ut - (long)ac6)*(long)ac5) >> 15;
 x2 = ((long)mc << 11)/(x1 + md);
 b5 = x1 + x2;

 return ((b5 + 8)>>4);  
}

//----------------------------------------------------------------------------------------------------------
// Calculate pressure given up
// calibration values must be known
// b5 is also required so bmp085GetTemperature(...) must be called first.
// Value returned will be pressure in units of Pa.
long bmp085GetPressure(unsigned long up)
{
 long x1, x2, x3, b3, b6, p;
 unsigned long b4, b7;
 
 b6 = b5 - 4000;
 // Calculate B3
 x1 = (b2 * (b6 * b6)>>12)>>11;
 x2 = (ac2 * b6)>>11;
 x3 = x1 + x2;
 b3 = (((((long)ac1)*4 + x3)<<OSS) + 2)>>2;
 
 // Calculate B4
 x1 = (ac3 * b6)>>13;
 x2 = (b1 * ((b6 * b6)>>12))>>16;
 x3 = ((x1 + x2) + 2)>>2;
 b4 = (ac4 * (unsigned long)(x3 + 32768))>>15;
 
 b7 = ((unsigned long)(up - b3) * (50000>>OSS));
 if (b7 < 0x80000000)
   p = (b7<<1)/b4;
 else
   p = (b7/b4)<<1;
   
 x1 = (p>>8) * (p>>8);
 x1 = (x1 * 3038)>>16;
 x2 = (-7357 * p)>>16;
 p += (x1 + x2 + 3791)>>4;
 
 return p;
}

//----------------------------------------------------------------------------------------------------------
// Read 1 byte from the BMP085 at 'address'
char bmp085Read(unsigned char address)
{
 unsigned char data;
 
 Wire.beginTransmission(BMP085_ADDRESS);
 Wire.write(address);
 Wire.endTransmission();
 
 Wire.requestFrom(BMP085_ADDRESS, 1);
 while(!Wire.available())
   ;
   
 return Wire.read();
}

//----------------------------------------------------------------------------------------------------------
// Read 2 bytes from the BMP085
// First byte will be from 'address'
// Second byte will be from 'address'+1
short bmp085ReadInt(unsigned char address)
{
 unsigned char msb, lsb;
 
 Wire.beginTransmission(BMP085_ADDRESS);
 Wire.write(address);
 Wire.endTransmission();
 
 Wire.requestFrom(BMP085_ADDRESS, 2);
 while(Wire.available()<2)
   ;
 msb = Wire.read();
 lsb = Wire.read();
 
 return (short) msb<<8 | lsb;
}

//----------------------------------------------------------------------------------------------------------
// Read the uncompensated temperature value
unsigned short bmp085ReadUT()
{
 unsigned short ut;
 
 // Write 0x2E into Register 0xF4
 // This requests a temperature reading
 Wire.beginTransmission(BMP085_ADDRESS);
 Wire.write(0xF4);
 Wire.write(0x2E);
 Wire.endTransmission();
 
 // Wait at least 4.5ms
 delay(5);
 
 // Read two bytes from registers 0xF6 and 0xF7
 ut = bmp085ReadInt(0xF6);
 return ut;
}

//----------------------------------------------------------------------------------------------------------
// Read the uncompensated pressure value
unsigned long bmp085ReadUP()
{
 unsigned char msb, lsb, xlsb;
 unsigned long up = 0;
 
 // Write 0x34+(OSS<<6) into register 0xF4
 // Request a pressure reading w/ oversampling setting
 Wire.beginTransmission(BMP085_ADDRESS);
 Wire.write(0xF4);
 Wire.write(0x34 + (OSS<<6));
 Wire.endTransmission();
 
 // Wait for conversion, delay time dependent on OSS
 delay(2 + (3<<OSS));
 
 // Read register 0xF6 (MSB), 0xF7 (LSB), and 0xF8 (XLSB)
 Wire.beginTransmission(BMP085_ADDRESS);
 Wire.write(0xF6);
 Wire.endTransmission();
 Wire.requestFrom(BMP085_ADDRESS, 3);
 
 // Wait for data to become available
 while(Wire.available() < 3)
   ;
 msb = Wire.read();
 lsb = Wire.read();
 xlsb = Wire.read();
 
 up = (((unsigned long) msb << 16) | ((unsigned long) lsb << 8) | (unsigned long) xlsb) >> (8-OSS);
 
 return up;
}
//----------------------------------------------------------------------------------------------------------
Title: Library missing
Post by: venksbond on Sep 16, 2013, 06:05 am
fatal error: util/delay.h: No such file or directory

I think some library works on UNO may not work in DUE. Any header file collection link for SAM3X8E?

Thanks
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: garygid on Sep 17, 2013, 03:56 pm
How about a Timer library that works properly?

DueTimer does not get the requested interval correct,
giving 49000 us when asked for 50000 (off by 1 ms).
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ivanseidel on Sep 17, 2013, 04:10 pm

How about a Timer library that works properly?

DueTimer does not get the requested interval correct,
giving 49000 us when asked for 50000 (off by 1 ms).


How about submiting an issue on the GitHub so that I can know about it, and try to fix it?  ;)

Remember that micros() has an very weird reading too... and it doesn't works properly. The correct way (maybe the one you used), is to use an osciloscope...

Also, make shure to notice that DueTimer tries to find the Best clock for the desired frequency. However, it might not be EXACLY to what you want...

If you can, try to set the timer to 51ms, instead of 49, and see if it works. If yes, than we have a bug...

But make shure to submit it on the issue page, please! https://github.com/ivanseidel/DueTimer/issues?state=open (https://github.com/ivanseidel/DueTimer/issues?state=open)

Ivan

--EDIT


Have just tested it with micros, and it's showing up exacly 50000uS.

Can you send me your code?

Ivan
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: MichaelBot on Sep 24, 2013, 12:43 am
Adafruit lib for NeoPixel works fine

(tested with 10 pixel of the stripe http://www.adafruit.com/products/1138)

http://forum.arduino.cc/index.php?PHPSESSID=ei2ghoroto35godf46e01t1en4&topic=144446.60

Even without level shifting the 3.3 V due pin to the 5 V input pin of the Neo pixel,
but not sure how stable this will be (datasheet says 0.7*Vcc min. for Vih = 3.5)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: m3741 on Oct 04, 2013, 04:43 am

You can't. They've not only wired the backup power pins to the +3.3V and GND, but also they have not populated the 32kHz crystal so you couldn't use the RTC even with normal power.


What version of the Due do you have? I've got R3 and the crystal and all parts are populated and work great. The crystal isn't enabled by default, but if you check out my post at http://forum.arduino.cc/index.php?topic=187128.0 (http://forum.arduino.cc/index.php?topic=187128.0) it is very easy to turn on.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: m3741 on Oct 04, 2013, 04:45 am
I created a Due EEPROM library using EEPROM that is already in the 16u2 on the board. It requires a hardware mod as well, but it's not terrible to do. http://forum.arduino.cc/index.php?topic=191298.0 (http://forum.arduino.cc/index.php?topic=191298.0)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Alexeyca on Oct 26, 2013, 04:55 am
any1 have library for DUE work with DHT22?
Title: Re: Arduino Due libraries (official and 3rd party) -- Minimal Mass Storage Class
Post by: haturi on Nov 19, 2013, 03:02 am
MINMSC driver is posted for Due :-

README.txt 2 KB
https://mega.co.nz/#!eVAliCqR!JGtk3AZ8rOeK6FC1gyYzVxiagyxR6NMF1FZWX4tXXd0 (https://mega.co.nz/#!eVAliCqR!JGtk3AZ8rOeK6FC1gyYzVxiagyxR6NMF1FZWX4tXXd0)

minmsc_2013_11_17_v1_0.zip 9.8 MB
https://mega.co.nz/#!TZQniIhJ!U90u-RzsXLRNUTgkdbnTxWPMDOF7f7yUOTJWInHzbGg (https://mega.co.nz/#!TZQniIhJ!U90u-RzsXLRNUTgkdbnTxWPMDOF7f7yUOTJWInHzbGg)

This driver will allow a sketch to do raw read/writes on a thumb drive attached to Native USB AB port of Due.  A card reader with any media can also be used.

This driver works with old sdfat20130629 (can be downloaded from Google Code) by replacing two files.  Then one can use all the sketches shipped with old sdfat on the USB device on AB port... no shield needed.

MINMSC is essentially a minimal Mass Storage Class driver following USBIF spec and drives devices that report as transparent SCSI.

Regards.
Title: Re: Arduino Due libraries (official and 3rd party) MINMSC Driver v1.1
Post by: haturi on Nov 28, 2013, 01:32 am
The MINMSC released on 18 Nov 2013 has some obvious bugs.  This version attempts to correct them.  It is still the same Mass Storage Class driver on the Native USB port on Due... but now runs fine with IDE 1.5.4 and SdFat dated 2013-06-29.   You can download the sdfat20130629 from Google Code.

README.txt 2 KB
https://mega.co.nz/#!HJRT2LRJ!F1bT-1CdDMv9U5dJy6E8VUUUk50e4QG7gyUOftsdCFg (https://mega.co.nz/#!HJRT2LRJ!F1bT-1CdDMv9U5dJy6E8VUUUk50e4QG7gyUOftsdCFg)

Source Code:
minmsc_2013_11_27_v1_1.zip 90 KB
https://mega.co.nz/#!6BoGFYSB!fC3VS3dnFeiF-lfqRaBmeDYkltpJbrKr65il-h60NrM (https://mega.co.nz/#!6BoGFYSB!fC3VS3dnFeiF-lfqRaBmeDYkltpJbrKr65il-h60NrM)

Just Documentation:
minmsc_doc_2013_11_27_v1_1.zip 9.7 MB
https://mega.co.nz/#!KcBw1BhK!Dyu8LUZXGiZQ6UJKTtmjC1GACtYEfMSjernCfEB8KuQ (https://mega.co.nz/#!KcBw1BhK!Dyu8LUZXGiZQ6UJKTtmjC1GACtYEfMSjernCfEB8KuQ)

Regards.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: robtillaart on Nov 30, 2013, 10:44 am

any1 have library for DUE work with DHT22?

My DHT lib is recently upgraded to support DUE, not tested myself, please give it a try
see - http://playground.arduino.cc/Main/DHTLib -
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: boredman on Dec 22, 2013, 04:28 pm

I'm hoping for one for the RFM12 line of wireless modules.  Anyone know if that one has been ported yet?


Hi,
I've successfully modified RFM12B library by Felix of LowPowerLab.com to work on DUE. Not all functionality has been implemented yet, like sleep mode, but overall, it works.
Here's the link to files:
http://boredomprojects.net/images/Articles/HomeEnergy/RFM12B_Due_v006.zip (http://boredomprojects.net/images/Articles/HomeEnergy/RFM12B_Due_v006.zip)

Cheers!
Title: Success: Arduino DUE and ENC28J60 using UIPEthernet-lib
Post by: ntruchsess on Jan 09, 2014, 07:01 pm
http://forum.arduino.cc/index.php?topic=164281.msg1539562#msg1539562
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: F4LK0 on Jan 12, 2014, 09:28 pm
I installed the new release of Arduino IDE 1.5.5. but I have some problem.

1. in I2C comunication, infact if I try to use the MLX90914 sensor I can't read value.

2. I have a sketch that read from analog input the value of accelerometer. after I installed the IDE 1.5.5 I can't read correctly the value.

somebody can help me?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ncooper on Feb 22, 2014, 06:54 pm

Library:  pwm01.h
Description:  A clean alternate approach for setting up unique PWM frequencies from within a sketch, for any or all PWM pins.  The trick is to utilize the two PWM clocks (CLKA & CLKB) provided by the SAM3X8E chip.

I wrote and enclosed a library (pwm01.h).  It includes 4 user functions to:  1) setup PWM resolution, 2) setup PWM pin, frequency & pick clock, 3) write duty cycle, and 4) stop PWM.  See example code for usage:

Code: [Select]
#include "C:\Programs\arduino-1.5.1r2\hardware\arduino\sam\libraries\Pwm01\pwm01.h"

void setup()
{
   uint32_t  pwm_duty = 32767;
   uint32_t  pwm_freq1 = 2;  
   uint32_t  pwm_freq2 = 5000;

   // Set PWM Resolution
   pwm_set_resolution(16);  

   // Setup PWM Once (Up to two unique frequencies allowed
   //-----------------------------------------------------    
   pwm_setup( 6, pwm_freq1, 1);  // Pin 6 freq set to "pwm_freq1" on clock A
   pwm_setup( 7, pwm_freq2, 2);  // Pin 7 freq set to "pwm_freq2" on clock B
   pwm_setup( 8, pwm_freq2, 2);  // Pin 8 freq set to "pwm_freq2" on clock B
   pwm_setup( 9, pwm_freq2, 2);  // Pin 9 freq set to "pwm_freq2" on clock B
     
   // Write PWM Duty Cycle Anytime After PWM Setup
   //-----------------------------------------------------    
   pwm_write_duty( 6, pwm_duty );  // 50% duty cycle on Pin 6
   pwm_write_duty( 7, pwm_duty );  // 50% duty cycle on Pin 7
   pwm_write_duty( 8, pwm_duty );  // 50% duty cycle on Pin 8
   pwm_write_duty( 9, pwm_duty );  // 50% duty cycle on Pin 9

   delay(30000);  // 30sec Delay; PWM signal will still stream
       
   // Force PWM Stop On All Pins
   //-----------------------------    
   pwm_stop( 6 );
   pwm_stop( 7 );
   pwm_stop( 8 );
   pwm_stop( 9 );
}

void loop()
{  
}



The pwm01.h library and example code were tested in IDE 1.5.1r2.  Additional notes on this library:
- Applies to Arduino-Due board, PWM pins 6, 7, 8 & 9.
- Libary Does not operate on the TIO pins.
- Unique frequencies set via PWM Clock-A ("CLKA") and Clock-B ("CLKB")
 Therefore, up to two unique frequencies allowed.
- Set max duty cycle counts (pwm_max_duty_Ncount) equal to 255 per Arduino approach.  
 This value is best SUITED for low frequency applications (2hz to 40,000hz) such as
 PWM motor drivers, 38khz infrared transmitters, etc.
- Future library versions will address high frequency applications.
- Arduino's "wiring_analog.c" function was very helpful in this effort.



Have you updated this library recently to accommodate higher frequencies? I am in need of 250kHz+ for a senior design project. I am new to Arduino, and my background is EE...I am not the best with programming.

If anyone has been able to use this code or another library to get HF PWM please let me know! Any help is appreciated.

Thanks!
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: gcharles on Mar 02, 2014, 11:04 am
Is there any library like Tinywebserver compatible  with the DUE I have a project rumming on Mega 2560 and want to move to DUE


Thanks
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Sailor_Max on Apr 10, 2014, 06:47 pm
Hi folks,
I am encountering a problem compiling the TimeSerial example from the Time.h lib.
First I was getting all kind of interesting error mesages in my own project. In order to trace it down, after some fiddling - I now try to just compile the TimeSerial example. It first gives an error message on line 79 "Serial.print ( TIME_REQUEST, BYTE)" this is fixed by modifying it to "Serial.write".

Now I´m getting the following error message:


Arduino: 1.5.6-r2 (Windows 8), Board: "Arduino Due (Programming Port)"

Build options changed, rebuilding all

In file included from c:\program files (x86)\arduino\hardware\tools\g++_arm_none_eabi\bin\../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/stdio.h:46,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/Print.h:24,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/Stream.h:26,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/HardwareSerial.h:24,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/Arduino.h:183,
                 from TimeSerial.pde:18:
c:\program files (x86)\arduino\hardware\tools\g++_arm_none_eabi\bin\../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/sys/types.h:109: error: conflicting declaration 'typedef long int time_t'
C:\cop\Documents\Arduino\libraries\Time/Time.h:15: error: 'time_t' has a previous declaration as 'typedef long unsigned int time_t'

  Dieser Report hätte mehr Informationen mit
  "Ausführliche Ausgabe während der Kompilierung"
  aktiviert in Datei > Einstellungen[/font][/color]


I do have installed the Time.h lib (original dating22.07.2011, as well as a more recent version from prjc.com dated 27.03.2012) in the libraries directory, imported the lib in the IDE, restarted the IDE  to no effect.
Further obseration: A `normal´ #include <xyz.h> will change the color of the .h file in the IDE automatically, in case of Time.h there is no change.

I´m stuck - can you help?

regards Matthias
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: TexArduino on Apr 14, 2014, 11:49 am
AccelStepper.h for stepper control of position, speed and acceleration:

https://github.com/adafruit/AccelStepper (https://github.com/adafruit/AccelStepper)

DueFlashStorage for the use of flash memory, read and write:

https://github.com/sebnil/DueFlashStorage (https://github.com/sebnil/DueFlashStorage)

UTFT.h for display lcd, tested with 7" display cte70:
WARNING: the functions with RGB on the parameters reverse the R with B so it uses BGR. So to solve the problem you have to modify the library function. Remember that the rgb color are saved in a word build like that
MSB->rrrrrggggggbbbbb.
so use this code for the reversing

Code: [Select]

temp1=( (col>>8) & 0x07) | ( ( (col & 0xff) & 0x1f)<<3);
temp2=( (col & 0xff) & 0xE0) | ( ( (col>>8) &  0xf8)>>3);


then unificate temp1 and temp2 in a single word



http://henningkarlsen.com/electronics/library.php?id=52 (http://henningkarlsen.com/electronics/library.php?id=52)

UTouch.h for control of a touch screen.
NOTE: pins used are "Clock,Chip Select,Digital in,Digital out,Irq"

http://www.henningkarlsen.com/electronics/library.php?id=55


Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Pelosh on Apr 19, 2014, 08:51 am
I modified the SimpleModbusSlave lib found at :
https://docs.google.com/file/d/0B0B286tJkafVWVRveVZ3V2N2Q2M/edit?pli=1
... to work on DUE. One can user hardware USART 0,1,2.

I also added a _fonc option , the SimpleModbusSlave_DUE_fonc, so one can do something in the main sketch BEFORE response (useful to compute value of regs). A 2nd fonction is  to update some sketch variables form 1 master global order.

Title: Re: Arduino Due libraries (official and 3rd party)
Post by: wanderson on Apr 25, 2014, 07:34 pm
The final release of the Entropy library, which provides a source of true, cryptographically secure, random numbers on most Arduino platforms, including the UNO, MEGA, Teensy, and Due. 

This final release builds upon the earlier beta releases methods for providing various types of random integers to now also provide random floats, as well as a new method to provide random floats with a gaussian distribution.  All other methods use a uniform distribution, where each possible value has an equal chance of occurring, while the gaussian distribution allows you to specify a mean (average) value and a standard deviation.  This will then produce a series of random floats that would demonstrate those characteristic values if analyzed.  If graphed they would display the typical 'bell curve'.  This new method is most useful for certain types of simulations.  On the AVR based Arduino's as well as the Teensy boards, the library uses timer jitter as the source of the random numbers; however, on the Due it uses the internal hardware random number generator. 

The complete source, along with tests and test results for the library is available from the Google Code depository <http://code.google.com/p/avr-hardware-random-number-generation/ (http://code.google.com/p/avr-hardware-random-number-generation/)>.  For those who just want the library to use, it is available for download from the libraries web page <https://sites.google.com/site/astudyofentropy/project-definition/timer-jitter-entropy-sources/entropy-library (https://sites.google.com/site/astudyofentropy/project-definition/timer-jitter-entropy-sources/entropy-library)>.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: hbierau on Jun 04, 2014, 12:01 am
I have successfully tested this Button Library:

http://log.liminastudio.com/itp/physical-computing/arduino-a-new-improved-button-library-with-some-handy-features (http://log.liminastudio.com/itp/physical-computing/arduino-a-new-improved-button-library-with-some-handy-features)

It is indeed a very handy library featuring multiple button instances, with pull-up option, debouncing, it distinguishes between pressing shortly and holding the button pressed, etc.  
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: McNeight on Jun 19, 2014, 09:06 am
I've incorporated the existing work by Collin Kidder and Daniel Kasamis on due_can into a "unified" CAN library.  One simple API gets you functionality for three different types of CAN controller; Microchip MCP2515, Atmel SAM3X (Due), and Freescale K2x (Teensy 3.1). It's not quite finished yet, but if you are interested in using it, take a look at https://github.com/McNeight/CAN-Library/

Comments and patches are more than welcome.

-Neil
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: darkness1222 on Jun 25, 2014, 03:33 pm
I have the same problem with libraries, but my error is avr/sleep.h:no such file... I get this error when i try to compile BLE Shield example for Arduino Due. Any solution..? Thanks for reply.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: oxnar on Aug 21, 2014, 10:23 am

Library:  pwm01.h
Description:  A clean alternate approach for setting up unique PWM frequencies from within a sketch, for any or all PWM pins.  The trick is to utilize the two PWM clocks (CLKA & CLKB) provided by the SAM3X8E chip.

I wrote and enclosed a library (pwm01.h).  It includes 4 user functions to:  1) setup PWM resolution, 2) setup PWM pin, frequency & pick clock, 3) write duty cycle, and 4) stop PWM.  See example code for usage:

Code: [Select]
#include "C:\Programs\arduino-1.5.1r2\hardware\arduino\sam\libraries\Pwm01\pwm01.h"

void setup()
{
   uint32_t  pwm_duty = 32767;
   uint32_t  pwm_freq1 = 2;  
   uint32_t  pwm_freq2 = 5000;

   // Set PWM Resolution
   pwm_set_resolution(16);  

   // Setup PWM Once (Up to two unique frequencies allowed
   //-----------------------------------------------------    
   pwm_setup( 6, pwm_freq1, 1);  // Pin 6 freq set to "pwm_freq1" on clock A
   pwm_setup( 7, pwm_freq2, 2);  // Pin 7 freq set to "pwm_freq2" on clock B
   pwm_setup( 8, pwm_freq2, 2);  // Pin 8 freq set to "pwm_freq2" on clock B
   pwm_setup( 9, pwm_freq2, 2);  // Pin 9 freq set to "pwm_freq2" on clock B
     
   // Write PWM Duty Cycle Anytime After PWM Setup
   //-----------------------------------------------------    
   pwm_write_duty( 6, pwm_duty );  // 50% duty cycle on Pin 6
   pwm_write_duty( 7, pwm_duty );  // 50% duty cycle on Pin 7
   pwm_write_duty( 8, pwm_duty );  // 50% duty cycle on Pin 8
   pwm_write_duty( 9, pwm_duty );  // 50% duty cycle on Pin 9

   delay(30000);  // 30sec Delay; PWM signal will still stream
       
   // Force PWM Stop On All Pins
   //-----------------------------    
   pwm_stop( 6 );
   pwm_stop( 7 );
   pwm_stop( 8 );
   pwm_stop( 9 );
}

void loop()
{  
}



The pwm01.h library and example code were tested in IDE 1.5.1r2.  Additional notes on this library:
- Applies to Arduino-Due board, PWM pins 6, 7, 8 & 9.
- Libary Does not operate on the TIO pins.
- Unique frequencies set via PWM Clock-A ("CLKA") and Clock-B ("CLKB")
 Therefore, up to two unique frequencies allowed.
- Set max duty cycle counts (pwm_max_duty_Ncount) equal to 255 per Arduino approach.  
 This value is best SUITED for low frequency applications (2hz to 40,000hz) such as
 PWM motor drivers, 38khz infrared transmitters, etc.
- Future library versions will address high frequency applications.
- Arduino's "wiring_analog.c" function was very helpful in this effort.



Hello,

Probably a stupid question but where can I find this pwm01.h library?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: kd7eir on Aug 25, 2014, 10:52 am
The library is linked at the bottom of the post that you quoted.

Look for this -  pwm01.h (3.96 KB - downloaded 338 times.)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: samarth003 on Sep 16, 2014, 04:27 am
Hi,

Has anyone got the due working with SDI-12 library that is made available by stroudcenter. Github repo is:
https://github.com/StroudCenter/Arduino-SDI-12

I tried working with the SDI12 lib and due but ended up with the following error message:

home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp: In member function 'void SDI12::setState(uint8_t)':
/home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp:377:32: error: 'digitalPinToPCMSK' was not declared in this scope
     *digitalPinToPCMSK(_dataPin) &= ~(1<<digitalPinToPCMSKbit(_dataPin));
                                ^
/home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp:377:71: error: 'digitalPinToPCMSKbit' was not declared in this scope
     *digitalPinToPCMSK(_dataPin) &= ~(1<<digitalPinToPCMSKbit(_dataPin));
                                                                       ^
/home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp:389:29: error: 'digitalPinToPCICR' was not declared in this scope
  *digitalPinToPCICR(_dataPin) |= (1<<digitalPinToPCICRbit(_dataPin));
                             ^
/home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp:389:67: error: 'digitalPinToPCICRbit' was not declared in this scope
  *digitalPinToPCICR(_dataPin) |= (1<<digitalPinToPCICRbit(_dataPin));
                                                                   ^
/home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp:390:32: error: 'digitalPinToPCMSK' was not declared in this scope
     *digitalPinToPCMSK(_dataPin) |= (1<<digitalPinToPCMSKbit(_dataPin));
                                ^
/home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp:390:70: error: 'digitalPinToPCMSKbit' was not declared in this scope
     *digitalPinToPCMSK(_dataPin) |= (1<<digitalPinToPCMSKbit(_dataPin));
                                                                      ^
/home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp:394:31: error: 'digitalPinToPCMSK' was not declared in this scope
    *digitalPinToPCMSK(_dataPin) &= ~(1<<digitalPinToPCMSKbit(_dataPin));
                               ^
/home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp:394:70: error: 'digitalPinToPCMSKbit' was not declared in this scope
    *digitalPinToPCMSK(_dataPin) &= ~(1<<digitalPinToPCMSKbit(_dataPin));
                                                                      ^
/home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp:396:32: error: 'digitalPinToPCICR' was not declared in this scope
     *digitalPinToPCICR(_dataPin) &= ~(1<<digitalPinToPCICRbit(_dataPin));
                                ^
/home/bmubuntu/Arduino/libraries/Arduino-SDI-12-master/SDI12.cpp:396:71: error: 'digitalPinToPCICRbit' was not declared in this scope
     *digitalPinToPCICR(_dataPin) &= ~(1<<digitalPinToPCICRbit(_dataPin));

                                                                       ^
Sorry that i have to post it again here on the due forum.

I am using arduino-1.5.7.

Please help me in this regard.

Thanks!
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: MarekB on Sep 25, 2014, 12:06 pm
My own Due library for ILI9341 SPI displays:

Forum:
http://forum.arduino.cc/index.php?topic=265806.0 (http://forum.arduino.cc/index.php?topic=265806.0)

Github:
http://marekburiak.github.io/ILI9341_due (http://marekburiak.github.io/ILI9341_due)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: sadlerochit on Dec 04, 2014, 11:26 pm
I have just installed the Arduino DUE 1.5.8 Windows library from the zipfile so that I can use a microSD card on an Arduino Ethernet shield. However, despite there being an SD.h file in the zipfile it has not been installed in the "contributed" library - the only option offered in UECIDE - so when I try to compile my SD card sketch it fails because the #include <SD.h> statement is rejected. Can anyone tell me what I should do?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Rousselle on Dec 14, 2014, 06:27 am
RFM73 transceiver library now ported to the DUE, please consider there may be some tweaking/cleaning to be done but at least everyone can have something to play with.
Title: Updated WebServer Library
Post by: RayLivingston on Jan 02, 2015, 03:31 am
I recently had a need to use a Due as a web server.  I started with the excellent application posted here:

http://playground.arduino.cc/Code/WebServer

While it worked fine, it was not structured as a library, and parts were too hard-coded.  I did a bunch of mods, turned it into a library, and defined a few "helper" classes to implement a symbol table (for putting "live" data into the HTML on-the-fly), and for simplifying the content creation.  It currently supports GET and POST events, and will handle HTML, CSS, JPG, GIF and PNG data.  All content is addressed by virtual file paths.  While I did not carry forward the SD-card filesystem used in the original code (I don't have SD), it would be easy to add that back in.

All HTML and CSS source code and images are in the HTML subdirectory of the test application.  A Perl script, HTMLConvert.pl, i used to convert the content into c char arrays that get compiled into the application.

To try it out, just un-zip the archive to your local library directory, set the desired IP address near the top of the WebServerTest.ino or enable DHCP, then load it an go.  Point your browser to the default (hard) IP address application, compile and run.  Point your browser at that IP address, and it should all work.

Enjoy!

Regards,
Ray L.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: rblilja on Jan 18, 2015, 02:29 pm
Serial library using DMA. Needs more testing, as far I can tell though it works.

https://github.com/rblilja/DmaSerial
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: MorganS on Jan 21, 2015, 04:01 am
Serial library using DMA. Needs more testing, as far I can tell though it works.

https://github.com/rblilja/DmaSerial
Looks good. Really clean code. Good comments at the head of each function.

But what does it do? What are the limitations? Does it clobber any Arduino constructs, like can I use the same UART with both methods interchangeabley? A readme file would be very useful.

Any example code? It looks like the constructor requires a pointer to a UART but I don't know what that might look like.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: rblilja on Feb 01, 2015, 04:27 pm
Sorry for late reply - been working a lot lately. There is a README file added now. It explains how to "deactivate" the standard serial handling in Arduino. However, I think commenting out the old U(S)ARTClass objects are only necessary if you need to save space and never call e.g. Serial1.begin() after calling the begin() of DmaSerial.

About limitations. There are some todos marked in the code, e.g. supporting other confs than 8N1.

Usage is quite simple..

Outside loop() and setup():

#include "DmaSerial.h"

DmaSerial dma_serial  = DmaSerial((Uart*)USART0, ID_USART0);

USART0 is Serial1, USART1 is Serial2...


In setup():

dma_serial.begin(9600);

In loop() or where you want to use it:

dma_serial.put("THIS IS A TEST!\n");
dma_serial.putln("THIS IS ALSO A TES!");

uint8_t buffer[32];

dma_serial.get(buffer, 32);

Sorry for the sloppy explanation.. Will include a proper example sketch in the future..
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Rubbernose on Feb 07, 2015, 11:02 am
Hello,

i try to load a lot of my working 2560 Mega projects on a Due.
The actual Due IDE is 1.5.8. If i select a Mega it compiles.
If i select a Due (programming port)  a lot of errors happen...
With an I2C bus:
Code: [Select]
avr/io.h: No such file or directory
 #include <avr/io.h>

or if i use a clock:
Code: [Select]
Arduino: 1.5.8 (Linux), Board: "Arduino Due (Programming Port)"

Build options changed, rebuilding all
In file included from /home/elektro/Elektro/Arduino/arduino-1.5.8/hardware/arduino/sam/system/CMSIS/Device/ATMEL/sam3xa/include/sam3xa.h:44:0,
                 from /home/elektro/Elektro/Arduino/arduino-1.5.8/hardware/arduino/sam/system/CMSIS/Device/ATMEL/sam3.h:59,
                 from /home/elektro/Elektro/Arduino/arduino-1.5.8/hardware/arduino/sam/system/CMSIS/Device/ATMEL/sam.h:198,
                 from /home/elektro/Elektro/Arduino/arduino-1.5.8/hardware/arduino/sam/system/libsam/chip.h:25,
                 from /home/elektro/Elektro/Arduino/arduino-1.5.8/hardware/arduino/sam/cores/arduino/Arduino.h:42,
                 from Test.ino:6:
/home/elektro/Elektro/Arduino/arduino-1.5.8/hardware/arduino/sam/system/CMSIS/Device/ATMEL/sam3xa/include/sam3x8e.h:502:29: error: expected ')' before '*' token
 #define RTC        ((Rtc    *)0x400E1A60U) /**< \brief (RTC       ) Base Address */
                             ^
Test.ino:6:12: note: in expansion of macro 'RTC'
/home/elektro/Elektro/Arduino/arduino-1.5.8/hardware/arduino/sam/system/CMSIS/Device/ATMEL/sam3xa/include/sam3x8e.h:502:29: error: expected ')' before '*' token
 #define RTC        ((Rtc    *)0x400E1A60U) /**< \brief (RTC       ) Base Address */
                             ^
Test.ino:6:12: note: in expansion of macro 'RTC'
Test.ino: In function 'void setup()':
Test.ino:22:7: error: request for member 'begin' in '1074666080u', which is of pointer type 'Rtc*' (maybe you meant to use '->' ?)
Test.ino:31:13: error: request for member 'isrunning' in '1074666080u', which is of pointer type 'Rtc*' (maybe you meant to use '->' ?)
Test.ino:34:9: error: request for member 'adjust' in '1074666080u', which is of pointer type 'Rtc*' (maybe you meant to use '->' ?)
Test.ino: In function 'void loop()':
Test.ino:45:20: error: request for member 'now' in '1074666080u', which is of pointer type 'Rtc*' (maybe you meant to use '->' ?)
Fehler beim Übersetzen

  Dieser Report hätte mehr Informationen mit
  "Ausführliche Ausgabe während der Kompilierung"
  aktiviert in Datei > Einstellungen


Is there something wrong with my installation or are the Due-libraries still weak?
Is there no central Due support???
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: psghodasara on Mar 12, 2015, 05:33 pm
Finally succeeded to modified Adafruit RGB panel library for 16x32 rgb panel to suit arduino due.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Shyam827 on Mar 22, 2015, 02:50 am
I found it at here and it worked : https://codeload.github.com/enternoescape/Arduino-IRremote-Due/zip/master
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: rahultiwariec on Mar 24, 2015, 07:24 am
how i can interface arduino due with HC05 bluetooth module.....
i was doing but there was no response with due....
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: anm_cool on Mar 25, 2015, 06:43 pm
The MIFARE MFRC522 library works properly with arduino due.
The SPI ports have to be used for interfacing.
https://github.com/ljos/MFRC522
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: garygrewal on Apr 09, 2015, 12:26 am
I have created MIDI USB Library for Arduino Due.

https://github.com/gurbrinder/Arduino.git
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: edgardM on Apr 16, 2015, 01:45 pm
How to transform a library for arduino DUE?
I want use a library that it is for operate with matrices, but it is not working for Arduino Due. What I should change in the library for use the library in the Due?


These is the librery:

http://playground.arduino.cc/Code/MatrixMath

Thanks
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Steenoluf on Apr 21, 2015, 09:19 pm
I need to have the softwareserial.h or similar to run on a Due for a student project.
I have located 3 serial ports on the Due. Pls. advice: How do I get these ports up and running?

Regards, Steenoluf
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: sveinutne on May 25, 2015, 08:36 pm
Just got a DUE bord, and tried to compile. error can not find delay.h it is the _delay_ms() that I need.
Eny idea how I can work around it? Got IDE 1.6.4

Is there an easy way to change the code , so it will have different code when I want to run it on DUE and nano.
Maybe something like this, but for the delay.h

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

I guess I need to put in someting else, but this might be a sceleton I can use. If some got what I need to put in it will help.
Svein
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: lalo101097 on Jun 01, 2015, 11:37 pm
First release of the RTC Library for the Arduino Due.

2 examples included.

I would call it final for the moment.

And on github: https://github.com/MarkusLange/Arduino-Due-RTC-Library (https://github.com/MarkusLange/Arduino-Due-RTC-Library)

I hope the library is self explaining.

Markus

Update new library with unixtime and compilertime support

Update Version 1.2 now support for Date & Time in one operation for BKM.

And some changes all in the changelog

Update Version 1.3 now unixtime with timezone support with Example for it, for tevroc

Update Version 1.4 now support for geman timezone with Summertime.

Update Version 1.5 some changes in the Summertime Sketch, and updates at this point only on git

Update Version 1.6 added rtc_clock.timing to detect when the time was set in summer- or wintertime
(mostly helpfully for the german member)

Update Version 1.7 added rtc_clock.date_already_set() to proof if date is allready set, to prevent setting time again for Paul Stoffregen

Update Version 1.8 added rtc_clock.set_clock() to set __Time__,__Date__ in one line fixed bug in unixtime() and summertime() thanks to Paul Stoffregen for the hint
Hi, what are the pines to conect in DUE?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: SurferTim on Jun 06, 2015, 04:02 pm
I tested the ethernet library and it works with one minor difference. Do not set D10 as an OUTPUT in setup.

I tested these playground sketches and all work with the Due.
http://playground.arduino.cc/Code/WebClient
http://playground.arduino.cc/Code/WebServerST
http://playground.arduino.cc/Code/FTP
http://playground.arduino.cc/Code/Email
http://playground.arduino.cc/Code/POP3Email
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: SurferTim on Jun 06, 2015, 07:53 pm
I just tested the Pololu AHRS (9DOF) library, and it works.
https://github.com/pololu/minimu-9-ahrs-arduino
I'm using it with the 10DOF board from Adafruit.
http://www.adafruit.com/product/1604
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: R_Hart on Jun 07, 2015, 04:53 am
A question for garygrewal: I looked through the library set you pointed to and didn't see anything related to USB MIDI, did i miss it? It looked like there was just the usual HID, keyboard, etc., but nothing I could see related to MIDI. Was I looking at the wrong branch (I used the URL you posted), or are the methods buried somewhere else in the library and I just missed it?

I'm very interested in trying to use such a library with a project I working on, so any help in finding your work is greatly appreciated.

Bob Hart
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: SurferTim on Jun 19, 2015, 11:02 pm
The Adafruit 16 channel PWM/servo library works with the Due. If you use the breakout board, insure you use the new SDA and SCL pins (Wire1) next to the AREF pin.
https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: antodom on Jul 29, 2015, 12:21 pm
Hi all,

I have developed a software serial library for the Arduino DUE which provides up to nine software serial objects associated with the Timer/Counter module channels available in the Atmel ATSAM3X8E. You can use those serial objects in the same manner that the hardware serial objects Serial, Serial1, Serial2 and Serial3.

I have called the library soft_uart, and it is openly available in the following link:

 http://bizet.dis.ulpgc.es/antodom/soft_uart (http://bizet.dis.ulpgc.es/antodom/soft_uart)

I have checked the library intensively with the hardware I have available, but any feedback or suggestion for improvement will be welcomed.

I hope it helps.

----
antodom
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: antodom on Jul 29, 2015, 07:43 pm
Hi all,

I have made a small improvement to WInterrupts.c which allows a faster interrupt dispatching associated to generic I/O pins. That is, the callbacks we set with function attachInterrupt().

Basically I have modified the code of the interrupt handler functions PIOA_Handler(), PIOB_Handler(), PIOC_Handler() and PIOD_handler() in the original WInterrupts.c. The improvement consists mainly in taking advantage of ATSAM3XE assembler instruction CLZ. With this instruction it is possible to calculate the number of leading zeros in a 32 bit value in just one machine instruction. CLZ is available in C/C++ using CMSIS function __CLZ().

Using this small improvement I have been able to get to a bit rate of 115200 with my software serial library for the DUE, soft_uart (http://bizet.dis.ulpgc.es/antodom/soft_uart) (using the example provided with soft_uart and two stop bits). Take into account that soft_uart uses the interrupt for pin level changes on the RX pin associated to the software serial object when used. Without the improvement soft_uart could only get to 57600 (same example also with two stop bits).
                                                                                     
Herein I include attached the file WInterrupts.c with the PIO handlers modified (the previous versions of the handlers are also on the file, but commented). To illustrate the change here you have the code for handler PIOA_Handler() (the previous one appears commented), the other ones are alike:

Code: [Select]

//void PIOA_Handler(void) {
//      uint32_t isr = PIOA->PIO_ISR;                                                
//      uint32_t i;
//      for (i=0; i<32; i++, isr>>=1) {                                              
//              if ((isr & 0x1) == 0)                                                
//                      continue;
//              if (callbacksPioA[i])                                                
//                      callbacksPioA[i]();                                          
//      }      
//}                    

void PIOA_Handler(void) {                                                            
 register uint32_t isr = PIOA->PIO_ISR;                                              
 register uint8_t leading_zeros;                                                    
 while((leading_zeros=__CLZ(isr))<32)
 {
   register uint8_t pin=32-leading_zeros-1;                                          
   if(callbacksPioA[pin]) callbacksPioA[pin]();                                      
   isr=isr&(~(1<<pin));
 }
}


If you want to check this version of WInterrupts.c just overwrite the original with this new one.

Sincerely, I consider this change can benefit any code using interrupts associated to any Arduino DUE I/O pin with function attachInterrupt(). Once tested enough by more people, maybe it might be convenient to apply the change to the official Arduino DUE standard library. Anybody knows to whom I have to address to propose the change?.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: bikas on Aug 04, 2015, 12:59 pm
@antodom

""Anybody knows to whom I have to address to propose the change?""

i am not sure but probably Nick Gammon is the one you are looking for.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: krtushink on Aug 20, 2015, 08:04 am
Hi, I'm having a lot of problems with the libraries of DHT22 humidity and temperature sensor and Arduino DUE.

It seems to have an ARM microcontroller, that driver must have a configuación different pins, and not just go well.

There is someone who can send me a code that I work at least to put the value in a variable moisture and other temperature value?

From there and I would deal myself.

Thank you so much for everything.

Cheers,
Xavi
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ArthurD on Sep 10, 2015, 11:28 am
is there meanwhile a reasonable USB keyb lib available feat. standard C keyboard functions (stdin) like e.g.

kbhit()
getch()
getche()
getchar()
gets()
scanf()

?

currently the implementation of the USB.task is really weird, keyPressed and keyReleased don't return anything and it's totally osbscured how and when they do either or anything meaningful,
currently it's not even possible to indicate if a key was hit at all or not (like provided by kbhit() ),
usb.Task has to be called repeatedly but then blocks program execution intermediately and repeatedly for many seconds (which is unconscionable in the main loop() but shockingly also hinders different additional Scheduler multitasking threads ).
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: josheeg on Sep 15, 2015, 01:30 pm
I noticed my post on the Eigen library was for the pc and not the arduino one I wrote for the Due.
I used the library tutorial and got the newest stable release of Eigen to run.
I wold add my ziped library file if I could to make it easier to run Eigen libraries on the DUE in win/linux/mac.
A header and ccp file was needed I named the folder in home/arduino/libraries EIGEN.
The header file was Eigen.h and program file Eigen.cpp

Code: [Select]
/*
  Eigen.h - Library for adding Eigen library code.
  Created by Joshua Wojnas, September 15, 2015.
*/

#ifndef Eigen_h
#define Eigen_h

#include "Dense"
#include "LU"
#include "Arduino.h" //statement that gives you access to the standard types and constants of the Arduino

using Eigen::MatrixXd;
using namespace std;
using namespace Eigen;


#endif



Code: [Select]
/*
  Eigen.cpp - Library for adding Eigen library code.
  Created by Joshua Wojnas, September 15, 2015.
*/

#include "Dense"
#include "LU"
#include "Arduino.h"//give the rest of the code access to the standard Arduino functions
#include "Eigen.h"

using Eigen::MatrixXd;
using namespace std;
using namespace Eigen;



Then their was the program I used to test it by randomvibe

Code: [Select]
//Eigan library test by josheeg example by random vibe and eigen library team.
#include <Eigen.h>

// PRINT MATRIX (float type)
// By: randomvibe
//-----------------------------


void print_mtxf(const Eigen::MatrixXf& K);


void setup()
{
  Serial.begin(9600);

  // DECLARE MATRICES
  //--------------------
  MatrixXf Pp(6, 6);  // Produces 6x6 float matrix class
  MatrixXf H(6, 6);   // Note: without "using namespace Eigen", declaration would be: Eigen::MatrixXf H(6,6);
  MatrixXf R(6, 6);
  MatrixXf X(6, 6);
  MatrixXf K(6, 6);
  MatrixXf Z(6, 6);

  // INPUT MATRICES (so-called comma-initialize syntax)
  //---------------------------------------------------------
  Pp << 0.3252,  0.3192,  1.0933, -0.0068, -1.0891, -1.4916,
  -0.7549,  0.3129,  1.1093,  1.5326,  0.0326, -0.7423,
  1.3703, -0.8649, -0.8637, -0.7697,  0.5525, -1.0616,
  -1.7115, -0.0301,  0.0774,  0.3714,  1.1006,  2.3505,
  -0.1022, -0.1649, -1.2141, -0.2256,  1.5442, -0.6156,
  -0.2414,  0.6277, -1.1135,  1.1174,  0.0859,  0.7481 ;

  H << 0.8147, 0.2785, 0.9572, 0.7922, 0.6787, 0.7060,
  0.9058, 0.5469, 0.4854, 0.9595, 0.7577, 0.0318,
  0.1270, 0.9575, 0.8003, 0.6557, 0.7431, 0.2769,
  0.9134, 0.9649, 0.1419, 0.0357, 0.3922, 0.0462,
  0.6324, 0.1576, 0.4218, 0.8491, 0.6555, 0.0971,
  0.0975, 0.9706, 0.9157, 0.9340, 0.1712, 0.8235;

  R << 0.3252,  0.3192,  1.0933, -0.0068, -1.0891, -1.4916,
  -0.7549,  0.3129,  1.1093,  1.5326,  0.0326, -0.7423,
  1.3703, -0.8649, -0.8637, -0.7697,  0.5525, -1.0616,
  -1.7115, -0.0301,  0.0774,  0.3714,  1.1006,  2.3505,
  -0.1022, -0.1649, -1.2141, -0.2256,  1.5442, -0.6156,
  -0.2414,  0.6277, -1.1135,  1.1174,  0.0859,  0.7481;


  // Kalman Gain Example; Matlab form:  K = Pp * H' * inv(H * Pp * H' + R)
  //-----------------------------------
  X  = H * Pp * H.transpose() + R;
  K  = Pp * H.transpose() * X.inverse();


  // Print Result
  //----------------------------
  print_mtxf(K);      // Print Matrix Result (passed by reference)


}

void loop()
{
 }


// PRINT MATRIX (float type)
// By: randomvibe
//-----------------------------
void print_mtxf(const Eigen::MatrixXf& X) 
{
   int i, j, nrow, ncol;
   
   nrow = X.rows();
   ncol = X.cols();

   Serial.print("nrow: "); Serial.println(nrow);
   Serial.print("ncol: "); Serial.println(ncol);     
   Serial.println();
   
   for (i=0; i<nrow; i++)
   {
       for (j=0; j<ncol; j++)
       {
           Serial.print(X(i,j), 6);   // print 6 decimal places
           Serial.print(", ");
       }
       Serial.println();
   }
   Serial.println();
}
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: josheeg on Sep 15, 2015, 01:35 pm
I found the quick reply does not let me add the zip file of my arduino due library to connect the Eigen library.

Also here is some test code after the arduino due eigen library is installed.

Code: [Select]
//Eigan library test by josheeg example by random vibe and eigen library team.
#include <Eigen.h>

// PRINT MATRIX (float type)
// By: randomvibe
//-----------------------------


void print_mtxf(const Eigen::MatrixXf& K);


void setup()
{
  Serial.begin(9600);

  // DECLARE MATRICES
  //--------------------
  MatrixXf Pp(6, 6);  // Produces 6x6 float matrix class
  MatrixXf H(6, 6);   // Note: without "using namespace Eigen", declaration would be: Eigen::MatrixXf H(6,6);
  MatrixXf R(6, 6);
  MatrixXf X(6, 6);
  MatrixXf K(6, 6);
  MatrixXf Z(6, 6);

  // INPUT MATRICES (so-called comma-initialize syntax)
  //---------------------------------------------------------
  Pp << 0.3252,  0.3192,  1.0933, -0.0068, -1.0891, -1.4916,
  -0.7549,  0.3129,  1.1093,  1.5326,  0.0326, -0.7423,
  1.3703, -0.8649, -0.8637, -0.7697,  0.5525, -1.0616,
  -1.7115, -0.0301,  0.0774,  0.3714,  1.1006,  2.3505,
  -0.1022, -0.1649, -1.2141, -0.2256,  1.5442, -0.6156,
  -0.2414,  0.6277, -1.1135,  1.1174,  0.0859,  0.7481 ;

  H << 0.8147, 0.2785, 0.9572, 0.7922, 0.6787, 0.7060,
  0.9058, 0.5469, 0.4854, 0.9595, 0.7577, 0.0318,
  0.1270, 0.9575, 0.8003, 0.6557, 0.7431, 0.2769,
  0.9134, 0.9649, 0.1419, 0.0357, 0.3922, 0.0462,
  0.6324, 0.1576, 0.4218, 0.8491, 0.6555, 0.0971,
  0.0975, 0.9706, 0.9157, 0.9340, 0.1712, 0.8235;

  R << 0.3252,  0.3192,  1.0933, -0.0068, -1.0891, -1.4916,
  -0.7549,  0.3129,  1.1093,  1.5326,  0.0326, -0.7423,
  1.3703, -0.8649, -0.8637, -0.7697,  0.5525, -1.0616,
  -1.7115, -0.0301,  0.0774,  0.3714,  1.1006,  2.3505,
  -0.1022, -0.1649, -1.2141, -0.2256,  1.5442, -0.6156,
  -0.2414,  0.6277, -1.1135,  1.1174,  0.0859,  0.7481;


  // Kalman Gain Example; Matlab form:  K = Pp * H' * inv(H * Pp * H' + R)
  //-----------------------------------
  X  = H * Pp * H.transpose() + R;
  K  = Pp * H.transpose() * X.inverse();


  // Print Result
  //----------------------------
  print_mtxf(K);      // Print Matrix Result (passed by reference)


}

void loop()
{
 }


// PRINT MATRIX (float type)
// By: randomvibe
//-----------------------------
void print_mtxf(const Eigen::MatrixXf& X) 
{
   int i, j, nrow, ncol;
   
   nrow = X.rows();
   ncol = X.cols();

   Serial.print("nrow: "); Serial.println(nrow);
   Serial.print("ncol: "); Serial.println(ncol);     
   Serial.println();
   
   for (i=0; i<nrow; i++)
   {
       for (j=0; j<ncol; j++)
       {
           Serial.print(X(i,j), 6);   // print 6 decimal places
           Serial.print(", ");
       }
       Serial.println();
   }
   Serial.println();
}
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ArthurD on Sep 15, 2015, 02:55 pm
(perhaps cross posted, sorry)
I found this one, does this help?
https://github.com/vancegroup/EigenArduino
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: sharpx on Nov 17, 2015, 12:39 am
EDIT: Solved: Managed to find WInterrupts.c in C:\Users\<USERNAME>\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.4\cores\arduino
not sure if this is common but that's where is located in my installation, I can't remember if I did something strange when installing or if I had to add DUE at a later time than when I initially installed it.

Hi all,

I have made a small improvement to WInterrupts.c which allows a faster interrupt dispatching associated to generic I/O pins. That is, the callbacks we set with function attachInterrupt().

Basically I have modified the code of the interrupt handler functions PIOA_Handler(), PIOB_Handler(), PIOC_Handler() and PIOD_handler() in the original WInterrupts.c. The improvement consists mainly in taking advantage of ATSAM3XE assembler instruction CLZ. With this instruction it is possible to calculate the number of leading zeros in a 32 bit value in just one machine instruction. CLZ is available in C/C++ using CMSIS function __CLZ().
[...]
@antodom & all

I'm drawing a blank here - I can't find the WInterrupts.c in my installation containing PIOA_Handler, PIOB_Handler, etc, just the one for AVR based boards. I searched the arduino installation folder and that's the only one I have. Any help locating it would be greatly appreciated, I have IDE v1.6.5
By the way, the __CLZ solution is brilliant, looks to be about 4 times faster than the for()  loop.
Thanks in advance
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: antodom on Nov 18, 2015, 12:18 pm
Hi there @sharpx,

WInterrupts.c for Atmel's Due uC ATSAM3xE should be included in "$HOME/.arduino15/packages/arduino/hardware/sam/1.6.4/cores/arduino" (I´m using Arduino IDE 1.6.5) in Ubuntu 14.04 (the one I usually use), and in Windows last time I saw was something like "C:\Users\<your-user-name>\AppData\Roaming\arduino15\packages\arduino\hardware\sam\1.6.4\cores\arduino".


If you can not find it there, maybe, have you changed your installation paths for the Arduino IDE?.

Best
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: sharpx on Nov 18, 2015, 08:24 pm
@antodom
found it after I posted the message, crossed my mind to search the whole drive. There's probably a way to default installation to the same folder but since it works I'll leave it for now.
Thanks for the __CLZ trick, it's great - wish they added it to the dist since it's significantly faster especially if you're closer to the LSB, my 4+ times test was with bits 14 and 15.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Jagohu on Nov 19, 2015, 12:27 pm
Hi,

Does anyone know about a digitalIo library which works on the Due? This is the only one I'm missing at the moment, while I'm trying to migrate my gateway (NRF24L01, Ethernet shield) to Due from Mega...
Thank you!
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: antodom on Nov 19, 2015, 07:17 pm
@sharpx

I have already summited the WInterrupts.c improvement through a pull request for its inclusion in the Arduino standard library for the DUE. I hope it gets in soon.

Best.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: antodom on Nov 19, 2015, 08:02 pm
Hi all,

This post is just to announce that the software serial library for the DUE, soft_uart (already mentioned in a previous post (http://forum.arduino.cc/index.php?topic=144446.msg2335415#msg2335415)) is now on GitHub, in this link:

 https://github.com/antodom/soft_uart (https://github.com/antodom/soft_uart)

In addition, I would like to comment that the library has been improved with a new mode of operation in half-duplex, and a new bunch of examples illustrating its use. The library is completely compatible with the hardware serial objects Serial, Serial1, Serial2 and Serial3, and you can use the software serial objects provided by the library using the same serial API. Moreover, another improvement is that right now you can compile and upload the library and the examples on command line using CMake.

So far we have checked the library intensively with the hardware we have available, but any feedback or suggestion for improvement will be welcomed.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ArthurD on Nov 22, 2015, 11:45 am
is there an update to USB keyboard libs for the Due USB host port (HID, stdin), like on Raspberry Pi or on Windows PCs?

is there meanwhile a reasonable USB keyb lib available feat. standard C keyboard functions (stdin) like e.g.

kbhit()
getch()
getche()
getchar()
gets()
scanf()

?

currently the implementation of the USB.task is really weird, keyPressed and keyReleased don't return anything and it's totally osbscured how and when they do either or anything meaningful,
currently it's not even possible to indicate if a key was hit at all or not (like provided by kbhit() ),
usb.Task has to be called repeatedly but then blocks program execution intermediately and repeatedly for many seconds (which is unconscionable in the main loop() but shockingly also hinders different additional Scheduler multitasking threads ).
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ArthurD on Nov 26, 2015, 06:35 pm
looks and sounds as if the DUE finally has been abandoned by Arduino.cc (or at least is  treated more than stepmotherly)

:( :(
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: aghani05 on Nov 28, 2015, 12:50 pm
Greetings to all.
@ josheeg i want to find eigen values and eigen vector of complex matrix in arduino. And don't know how to do that . I have downloaded your eigen library and also the one that is available at github,,

Actually i am converting a matlab code to arduino . I am using arduino due board . Below is the sample code of matlab that i want to convert in arduino
 
 [V,Dia] = eig(Rxx);
[Y,Index] = sort(diag(Dia));
EN = V(:,Index(1:6-1));

Rxx is complex matrix of 6x6. I have created this matrix in arduino using complex.h library. Now i have to find eigen values and eigen vectors of this matrix. So what should i do ,can any one help?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: bbx10node on Dec 14, 2015, 10:17 am
currently the implementation of the USB.task is really weird, keyPressed and keyReleased don't return anything and it's totally osbscured how and when they do either or anything meaningful,
currently it's not even possible to indicate if a key was hit at all or not (like provided by kbhit() ),
usb.Task has to be called repeatedly but then blocks program execution intermediately and repeatedly for many seconds (which is unconscionable in the main loop() but shockingly also hinders different additional Scheduler multitasking threads ).
I recently began investigating USB host on Due. The keyboard example works OK here. There is an OTG to host cable on the native port for the keyboard. The programming port is connected to a PC. External power is plugged into the barrel connector. The keyboard does not work without external power.

IDE 1.6.6, Due board package 1.6.6., Due USB Host library 1.0.4. Latest versions of everything.

I wish there were another non-HID example because the ADK example is very confusing. I hooked an Android tablet but nothing happens on the Due or the tablet. I guess I have to dig in and find out what app, if any, is required on the Android side. And turn on trace debug.

Some keyboard output.


Program started
Pressed:   key:20 mod:0 => q
Released:  key:20 mod:0 => q
Pressed:   key:26 mod:0 => w
Released:  key:26 mod:0 => w
Pressed:   key:8 mod:0 => e
Released:  key:8 mod:0 => e
Pressed:   key:21 mod:0 => r
Released:  key:21 mod:0 => r
Pressed:   key:23 mod:0 => t
Released:  key:23 mod:0 => t
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: pistolero992000 on Dec 20, 2015, 01:28 am
Hi Guys,

I'm trying to implement the awesome TVOut library on the arduino due....

my results so far... https://youtu.be/3PaF-g1nPGE (https://youtu.be/3PaF-g1nPGE)

when I have the library working I'll upload it, for now, I think I'm getting somewhere...

by the way... this is the Sync Generation.... you may say it's like Grug from The Croods... but if you saw the video, it's working nice so far ;)

Code: [Select]
volatile int syncON, syncOFF;
volatile int LineCount;
char v1;
int i, r;
int vLines;

#define HRes 744
#define VRes 240
#define ScreenRatioCorrection (VRes * 53 / 18) / HRes
const float AspectRatioY = 4301075 / 10000000;
#define LinesToWait 10
#define ArraySize int(HRes/8 * VRes)
#define ScreenTop 0
#define ScreenBot VRes - 1

#define NOP __asm__("nop\n\t")
#define NOP10 NOP; NOP; NOP; NOP; NOP; NOP; NOP; NOP; NOP; NOP
#define NOP100 NOP10;NOP10;NOP10;NOP10;NOP10;NOP10;NOP10;NOP10;NOP10;NOP10

#define NOPLineSync NOP100;NOP100;NOP10;NOP10;NOP10;NOP10;NOP10;NOP10;NOP;NOP;NOP;NOP;NOP;NOP;NOP//;NOP//NOP10
#define NOPPrePixels NOP100;NOP100;NOP100;NOP100;NOP//;NOP//;NOP//;NOP;NOP//;NOP//;NOP//;NOP  //NOPLineSync
#define NOPPixel400 NOP;NOP;NOP;NOP;NOP;
#define NOPPixel640 NOP//;NOP

void setup() {
  Serial.begin(115200);
  pinMode(2, OUTPUT);
  pinMode(23, OUTPUT);
  pinMode(3, OUTPUT);   // port B pin 25
  analogWrite(3, 255);  // sets up some other registers I haven't worked out yet
  REG_TC2_WPMR = 0x54494D00; // enable write to registers
  //               33222222222211111111110000000000
  //               10987654321098765432109876543210
  REG_TC2_CMR1 = 0b00000000000010011100010000000000;
  // 1/50/625*84000000 - 1 = 2688: 64uS PER LINE /PAL STD
  // 1/60/525*84000000 - 1 = 2669.5: 63.55uS PER LINE /NTSC STD
  REG_TC2_RC1 = 2670;
  REG_TC2_RA1 = 0;  // PWM value 4.7uS
  REG_TC2_CCR1 = 0b101;  // start counter
  REG_TC2_IER1 = 0b00010000; // enable interrupt on counter=rc
  REG_TC2_IDR1 = 0b11101111; // disable other interrupts
  NVIC_EnableIRQ(TC7_IRQn); // enable TC7 interrupts
  NVIC_SetPriority(TC7_IRQn, 0); //sets Interrupt Priority to top

  LineCount = 0;
  syncON = ~1 << 25; // PIOB.25-->Pin D2 on the board
  syncOFF = 1 << 25;

  draw_line(0, 0, 0, VRes - 1, 1);
  draw_line(0, VRes - 1, HRes - 1, VRes - 1, 1);
  draw_line(HRes - 1, VRes - 1, HRes - 1, 0, 1);
  draw_line(HRes - 1, 0, 0, 0, 1);

  draw_line(HRes / 2 - 1, 0, HRes / 2 - 1, VRes - 1, 1);
  draw_line(0, VRes / 2 - 1, HRes - 1, VRes / 2 - 1, 1);

  draw_circle(HRes / 2 - 1, VRes / 2 - 1, 240, 1, 0);
  DrawEllipse(HRes / 2 - 1, VRes / 2 - 1, 100, 50, 1, 0);
  draw_circle(HRes / 2 - 1, VRes / 2 - 1, 50, 2, 1);
  randomSeed(analogRead(0));

}

void TC7_Handler()  // Interrupt every 64.07uS (PALSTD)
{
  long dummy = REG_TC2_SR1; // vital - reading this clears some flag otherwise you get infinite interrupts start the Horizontal sync pulse
 
  // **************************
  // ***** Sync Generation ****
  // **************************
  PIOB->PIO_ODSR = syncON;
  if (LineCount <= ScreenBot) NOPLineSync; // Generates the 4.7uS 0V sync pulse
  if (LineCount == 248) {   syncON = 1 << 25;    syncOFF = ~1 << 25;    NOPLineSync;  }
  if (LineCount == 251) {   syncON = ~1 << 25;    syncOFF = 1 << 25;    NOPLineSync;  }
  if (LineCount == 263) {    LineCount = 0;    NOPLineSync;  }
  if (LineCount <= (ScreenBot) && LineCount >= (ScreenTop + LinesToWait)) {    i = (LineCount - LinesToWait) * HRes / 8;  }
  PIOB->PIO_ODSR = syncOFF;
  // **************************
  // ***** Sync Generation ****
  // **************************

  if ((LineCount) <= (ScreenBot) && (LineCount) >= (ScreenTop + LinesToWait))
  {
    NOPPrePixels;
    for (int j = 0; j < int(HRes / 8); j++) {
      v1 = screen[i + j] ;
      PIOA->PIO_ODSR = (v1 & 128) <<  7;//NOPPixel640;  // PIOA.14-->Pin D23 on the board
      PIOA->PIO_ODSR = (v1 &  64) <<  8;//NOPPixel640;
      PIOA->PIO_ODSR = (v1 &  32) <<  9;//NOPPixel640;
      PIOA->PIO_ODSR = (v1 &  16) << 10;//NOPPixel640;
      PIOA->PIO_ODSR = (v1 &   8) << 11;//NOPPixel640;
      PIOA->PIO_ODSR = (v1 &   4) << 12;//NOPPixel640;
      PIOA->PIO_ODSR = (v1 &   2) << 13;//NOPPixel640;
      PIOA->PIO_ODSR = (v1 &   1) << 14;//NOPPixel640;
    } 
    PIOA->PIO_ODSR = ~1 << 14;
  }
  LineCount++;

}



I thank Stimmer for the Due Timer and the TVOut library designer for this project, they were the inspiration...

Next... NTSC Video overlay (Video Experimenter @ https://nootropicdesign.com/ve/ (https://nootropicdesign.com/ve/)) ;)

this is the Arduino MEGA overlay using Video Experimenter concept :https://youtu.be/frtSf0sggEk (https://youtu.be/frtSf0sggEk)
cheers
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ArthurD on Dec 20, 2015, 03:48 pm
Quote
Program started
Pressed:   key:20 mod:0 => q
Released:  key:20 mod:0 => q
Pressed:   key:26 mod:0 => w
Released:  key:26 mod:0 => w
Pressed:   key:8 mod:0 => e
Released:  key:8 mod:0 => e
Pressed:   key:21 mod:0 => r
Released:  key:21 mod:0 => r
Pressed:   key:23 mod:0 => t
Released:  key:23 mod:0 => t
this is not how it is expected to work.

It should work by stdio.h and possibly conio.h functionality like, e.g.
Code: [Select]
char sbuf[20];
while(1) {
     if kbhit() {
        int c = getch();
        putchar(c);
        // or perhaps:
        // sprintf (sbuf, "%c", (char)c);
        // Serial.print(sbuf);
     }
     delay(10);   
  }
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: antodom on Jan 13, 2016, 11:24 am
Hi all,

This post is just to anounce that I have developed a library for the DUE which takes advantage of several features of the Timer Counter (TC) modules available in Atmel's ATSAM3X8E.

The name of the library is tc_lib and it is openly available at:

 https://github.com/antodom/tc_lib (https://github.com/antodom/tc_lib)


In its initial operative version the library provides two kind of objects:


You have available examples using both types of objects, I hope the examples are self-explaining.

More info about tc_lib in https://github.com/antodom/tc_lib (https://github.com/antodom/tc_lib).

Drop me a line if you have any question or interest.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: antodom on Jan 29, 2016, 08:58 pm
Hi all again :)

This is to announce the publication of a library which abstract the eight PWM channels available in Arduino DUE's ATSAM3X8E microcontroller.

The name of the library is pwm_lib, and is openly available at: https://github.com/antodom/pwm_lib (https://github.com/antodom/pwm_lib).

Each ATSAM3X8E PWM channel can be used to generate a completely independent PWM signal directly on hardware. The motivation to develop this library was two fold. First, the current limitation of the Arduino standard library where it is not possible to change the PWM output period of the PWM signals generated using function analogWrite(). And second, to have a library for servos directly supported by the hardware, therefore, "lighter", in terms of code generated and computational load, than the Servo library available in the Arduino standard library.

The library provides two kind of objects associated with each PWM channel: pwm and servo objects. As those objects abstract the PWM channels available on the micro controller, using pwm_lib you can use, at most, eight independent pwm_lib objects in your application, each one with its own PWM characteristics (PWM signal period and pulse duration). In its current version, the maximum period for PWM signals you can get using pwm_lib is a period of 0.798915048 seconds (minimum frequency of 1.251697539 Hz).

Two examples comes with pwm_lib to illustrate its use: basic_test.ino and servo_test.ino, who illustrate respectively the use of pwm and servo objects. Example basic_test.ino uses two PWM objects for generating two independent PWM outputs with different PWM characteristics (period and duty). Example servo_test.ino uses a servo object to generated a PWM output for a typical servo.

More details about pwm_lib in https://github.com/antodom/pwm_lib (https://github.com/antodom/pwm_lib).

And, if in any doubt, drop me a line.

I hope it helps.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: phr3ak on Mar 11, 2016, 06:10 pm
Which library you would recommend to connect an ESP8266 WiFi module? I vote for ITEADLIB_Arduino_ESP8266 (https://github.com/itead/ITEADLIB_Arduino_ESP8266)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: pjeve on Mar 26, 2016, 10:40 pm
@ antodom: thank you for the pwm_lib...

I have two little question:

1) is it possible to set "dynamically" the frequency/period as seem we can do with the duty cycle?

I mean a method "pwm_pinX.set_period(period_value);" like "pwm_pinX.set_duty(duty_value);"

I would like to make something like a polyphonic synthesizer and be able to manage the start-stop/freq/duty for every voice.

2) Are all the registers/counters used 16 bit, right?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: antodom on Mar 26, 2016, 11:58 pm
Hi there @pjeve,

For changing the frequency, use pwm_object.stop() first, and then pwm_object.start(period,duty), where you can set a new period.

In relation to your second question, the PWM counter is a 16 bit counter according to ATMSAM3X8E datasheet, but the resolution depends on the period you establish. In fact, due to that, in pwm_lib you specify the duty in time units, not in internal counter ticks. You can find out the number of counter ticks using function pwm_core::tick_time() using as argument, the returned value of pwm_core::find_clock() for the period you want to use (both functions are in pwm_defs.h).

Best.

Title: Re: Arduino Due libraries (official and 3rd party)
Post by: brandonLA on Apr 13, 2016, 03:11 am
For LCD Display with port expander PCF8574 library

https://github.com/nickgammon/I2C_graphical_LCD_display

For LCD display with menu navigation library

https://github.com/Jomelo/LCDMenuLib


cheers
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ArthurD on Apr 15, 2016, 10:41 pm
now what about a reasonable keyboard HID lib ?
when will there be finally one ?

this is not how it is expected to work.

It should work by stdio.h and possibly conio.h functionality like, e.g.
Code: [Select]
char sbuf[20];
while(1) {
     if kbhit() {
        int c = getch();
        putchar(c);
        // or perhaps:
        // sprintf (sbuf, "%c", (char)c);
        // Serial.print(sbuf);
     }
     delay(10);   
  }


Title: Re: Arduino Due libraries (official and 3rd party)
Post by: Sumit_jain on May 23, 2016, 03:53 pm
i there any library for DS18B20 temperature sensor compatible with due?? please share it.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: bilbo83 on May 23, 2016, 06:06 pm

On DUE, I'am using "OneWire". Excellent.

https://www.pjrc.com/teensy/td_libs_OneWire.html (https://www.pjrc.com/teensy/td_libs_OneWire.html)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ninja2 on Aug 21, 2016, 02:31 am
I have my Adafruit GPS working using the excellent NeoGPS library (https://github.com/SlashDevin/NeoGPS) that has only just been updated for Due by the author /Dev (SlashDevin).

It works fine on Due but note there are some limitations for Due compared to UNO or MEGA, e.g can't use interrupt driven mode yet as that requires  NeoHWSerial libary which has yet to be adapted. Hopefully these are only temporary limitations...

cheers
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: transmissions4less on Jan 18, 2017, 06:38 am
Eigen is a C++ library enabling Matlab and Octave-like matrix programming.  Eigen works very well with the Arduino Due.  As a Matlab user that appreciates minimalism, the Eigen library is written as plain header files. So no makefiles, no binary files, nothing to compile upfront, no headaches.
 
I downloaded it and tried on arduino 1.8 still no luck , appreciate any help
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: hibaS128 on Mar 15, 2017, 09:05 am
bojour
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: phr3ak on Jun 19, 2017, 04:40 pm
can you please recommend spi eeprom library for due?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ApNair on Jul 28, 2017, 08:17 am
Dear friends,


 I am in a big trouble, I designed a sensor system by interfacing AD 7705 ADC with ATMGA328P-AU.All the library files i downloaded from (http://www.kerrywong.com/2012/04/18/ad7705ad7706-library-revisited/ )
And it is working fine.

   Now i want to  change the controller to 32 bit SAM3x8e. The old library we used for AD7705 is not supporting. I am new with this controller, is there any one  to help me to find the solution. Can you suggest what change i should make in the old library.

hoping some one will help me .....................

Thank you..............
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ard_newbie on Jul 28, 2017, 11:53 am

IMO if you are not yet familiar with the DUE, I suggest that you begin with a code like this one:
http://forum.arduino.cc/index.php?topic=19963.0 (http://forum.arduino.cc/index.php?topic=19963.0)
and the AD7705 datasheet, until you succeed to read properly the AD conversions at a very low frequency using digitalRead / digitalWrite.

You will find the correct CPOL/CPHA combination thanks to the figures in the AD datasheet.
then you can adapt your code for the Sam3x8e SPI controller with a much higher frequency using direct register programming or SPI.h or TurboSpi.h if necessary.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: jpk on Aug 30, 2017, 12:30 am
a library for DUE / UNO / teensy which can handle multiple AD9850 modules connected to SPI (https://github.com/jpk73/AD9850_SPI)
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: potasheyt on Dec 12, 2017, 02:49 pm
Can someone show me how to use MFRC 522 on arduino DUE? it's running on nano uno and mega. but i cant make it work on DUE. my project need to use DUE and not other arduino. so please can anyone teach me how. im new in using arduino DUE. TIA
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: alcazar_juanc on Jan 25, 2018, 08:33 am
I need to use a complex math library for a school project. I found a library of that kind in this link: https://playground.arduino.cc/Main/ComplexMath but it doesn't compile in Arduino DUE. I think that I need to change something in either complex.cpp or complex.h but I don't know what to change.

When I try to upload the complex example of this library mentioned above, the following errors appear:

complex:16: error: 'COMPLEX_LIB_VERSION' was not declared in this scope

Serial.println(COMPLEX_LIB_VERSION);

              ^
complex:19: error: 'Complex' was not declared in this scope

Complex c1(10.0, -2.0);

^

complex:19: error: expected ';' before 'c1'

Complex c1(10.0, -2.0);

       ^
complex:20: error: expected ';' before 'c2'

Complex c2(3, 0);

       ^
complex:21: error: expected ';' before 'c3'

Complex c3(-10, 4);

       ^
complex:22: error: expected ';' before 'c4'

Complex c4(-5,-5);

       ^
complex:23: error: expected ';' before 'c5'

Complex c5(0, 0);

       ^
complex:25: error: 'one' was not declared in this scope

Serial.println(one);

              ^
complex:26: error: 'c1' was not declared in this scope

Serial.println(c1);

              ^
complex:27: error: 'c2' was not declared in this scope

Serial.println(c2);

              ^
complex:28: error: 'c3' was not declared in this scope

Serial.println(c3);

              ^
complex:29: error: 'c4' was not declared in this scope

Serial.println(c4);

              ^
complex:36: error: 'c5' was not declared in this scope

c5 = c1;

^

exit status 1
'COMPLEX_LIB_VERSION' was not declared in this scope

Does someone have any idea how to fix it?

I would really appreciate your help by telling me what to change or maybe it would be easier if someone shares the files of a complex library that works in Arduino DUE.

Beforehand thanks a lot.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: ard_newbie on Jan 25, 2018, 09:39 am
I tried to upload this Library this way, and I think it works (at least, I have no error at compile time):

Open a new sketch that you can call Complex.ino :

Code: [Select]

//
//    FILE: complex.ino
//  AUTHOR: Rob Tillaart
//    DATE: 2013-09-23
//
// PUPROSE: test complex math
//
// Serial.print(Complex) supported since 0.1.05

#include "complex.h"

void setup()
{
  Serial.begin(115200);
  Serial.print("\n  Complex numbers test for Arduino: ");
  Serial.println(COMPLEX_LIB_VERSION);
  Serial.println("\n1. Print Complex, set, real, imag");

  Complex c1(10.0, -2.0);
  Complex c2(3, 0);
  Complex c3(-10, 4);
  Complex c4(-5,-5);
  Complex c5(0, 0);

  Serial.println(one);
  Serial.println(c1);
  Serial.println(c2);
  Serial.println(c3);
  Serial.println(c4);
  c3.set(0,0);
  Serial.println(c3);
  Serial.println(c3.real());
  Serial.println(c3.imag());

  Serial.println("\n2. ==  != ");
  c5 = c1;
  if (c5 == c1) Serial.println("ok :)");
  else Serial.println(" fail :(");
  c5 = c1 + 1;
  if (c5 != c1) Serial.println("ok :)");
  else Serial.println(" fail :(");
  c5 = 3;
  if (c5 == 3) Serial.println("ok :)");
  else Serial.println(" fail :(");


  Serial.println("\n3. negation - ");
  c5 = -c1;
  Serial.println(c5);
  c5 = -c5;
  Serial.println(c5);
  if (c5 == c1) Serial.println("ok :)");
  else Serial.println(" fail :(");


  Serial.println("\n4. + - ");
  c5 = c1 + c2;
  Serial.println(c5);
  c5 = c1 + 3;
  Serial.println(c5);
  c5 = c1 - c2;
  Serial.println(c5);
  c5 = c1 - 3;
  Serial.println(c5);


  Serial.println("\n5. * / ");
  c5 = c1 * c2;
  Serial.println(c5);
  c5 = c5 * 3;
  Serial.println(c5);
  c5 = c5 / c2;
  Serial.println(c5);
  c5 = c5 / 3;
  Serial.println(c5);

  c5 = c1 / c2 * c2;
  Serial.println(c5);
  c5 = c1 * c4 / c4;
  Serial.println(c5);


  Serial.println("\n6. assign += -= *= /=");
  c5 = c1;
  c5 += c1;
  Serial.println(c5);
  c5 += 3;
  Serial.println(c5);
  c5 -= c1;
  Serial.println(c5);
  c5 -= 3;
  Serial.println(c5);
  c5 *= c1;
  Serial.println(c5);
  c5 *= 3;
  Serial.println(c5);
  c5 /= c1;
  Serial.println(c5);
  c5 /= 3;
  Serial.println(c5);


  Serial.println("\n7. phase modulus polar");
  Serial.println(c1);
  double m = c1.modulus();
  Serial.println(m);
  double p = c1.phase();
  Serial.println(p);
  c5.polar(m, p);
  Serial.println(c5);


  Serial.println("\n8. conjugate reciprocal");
  c5 = c1.conjugate();
  Serial.println(c5);
  c5 = c5.conjugate();
  Serial.println(c5);
  c5 = c1.reciprocal();
  Serial.println(c5);
  c5 = c5.reciprocal();
  Serial.println(c5);

  Serial.println("\n9. power: exp log pow sqrt sqr logn log10");
  c5 = c1.c_sqr();
  Serial.println(c5);
  c5 = c1.c_exp();
  Serial.println(c5);
  c5 = c5.c_log();
  Serial.println(c5);
  c5 = c1.c_pow(2);
  Serial.println(c5);
  c5 = c5.c_sqrt();
  Serial.println(c5);
  c5 = c5.c_sqr();
  Serial.println(c5);
  c5 = c1.c_pow(c2);
  Serial.println(c5);
  c5 = c5.c_pow(c2.reciprocal());
  Serial.println(c5);
  c5 = c5.c_logn(c4);
  Serial.println(c5);
  c5 = c4.c_pow(c5);
  Serial.println(c5);
  c5 = c5.c_log10();
  Serial.println(c5);

  Serial.println("\n10. gonio: sin cos tan asin acos atan");
  c1.set(0.5, 0.5);
  c5 = c1.c_sin();
  Serial.println(c5);
  c5 = c5.c_asin();
  Serial.println(c5);
  c5 = c1.c_cos();
  Serial.println(c5);
  c5 = c5.c_acos();
  Serial.println(c5);
  c5 = c1.c_tan();
  Serial.println(c5);
  c5 = c5.c_atan();
  Serial.println(c5);

  Serial.println("\n11. gonio csc sec cot acsc asec acot");
  c1.set(0.5, 0.5);
  c5 = c1.c_csc();
  Serial.println(c5);
  c5 = c5.c_acsc();
  Serial.println(c5);
  c5 = c1.c_sec();
  Serial.println(c5);
  c5 = c5.c_asec();
  Serial.println(c5);
  c5 = c1.c_cot();
  Serial.println(c5);
  c5 = c5.c_acot();
  Serial.println(c5);

  Serial.println("\n12. gonio hyperbolicus I ");
  c1.set(0.5, 0.5);
  c5 = c1.c_sinh();
  Serial.println(c5);
  c5 = c5.c_asinh();
  Serial.println(c5);
  c5 = c1.c_cosh();
  Serial.println(c5);
  c5 = c5.c_acosh();
  Serial.println(c5);
  c5 = c1.c_tanh();
  Serial.println(c5);
  c5 = c5.c_atanh();
  Serial.println(c5);

  Serial.println("\n13. gonio hyperbolicus II ");
  c1.set(0.5, 0.5);
  c5 = c1.c_csch();
  Serial.println(c5);
  c5 = c5.c_acsch();
  Serial.println(c5);
  c5 = c1.c_sech();
  Serial.println(c5);
  c5 = c5.c_asech();
  Serial.println(c5);
  c5 = c1.c_coth();
  Serial.println(c5);
  c5 = c5.c_acoth();
  Serial.println(c5);

  Serial.println("\n.. Complex done");

  uint32_t start = micros();
  for (int i=0; i<1000; i++)
  {
    c5 = c5.c_csc();
  }
  uint32_t dur = micros() - start;
  Serial.println(dur);
  Serial.println(one);
}

void loop()
{
}
//
// END OF FILE
//
/*  OUTPUT:
 *  
 Complex numbers test for Arduino: 0.1.09

1. Print Complex, set, real, imag
1.000 0.000i
10.000 -2.000i
3.000 0.000i
-10.000 4.000i
-5.000 -5.000i
0.000 0.000i
0.00
0.00

2. ==  !=
ok :)
ok :)
ok :)

3. negation -
-10.000 2.000i
10.000 -2.000i
ok :)

4. + -
13.000 -2.000i
13.000 -2.000i
7.000 -2.000i
7.000 -2.000i

5. * /
30.000 -6.000i
90.000 -18.000i
30.000 -6.000i
10.000 -2.000i
10.000 -2.000i
10.000 -2.000i

6. assign += -= *= /=
20.000 -4.000i
23.000 -4.000i
13.000 -2.000i
10.000 -2.000i
96.000 -40.000i
288.000 -120.000i
30.000 -6.000i
10.000 -2.000i

7. phase modulus polar
10.000 -2.000i
10.20
-0.20
10.000 -2.000i

8. conjugate reciprocal
10.000 2.000i
10.000 -2.000i
0.096 0.019i
10.000 -2.000i

9. power: exp log pow sqrt sqr logn log10
96.000 -40.000i
-9166.244 -20028.609i
10.000 -2.000i
96.000 -40.000i
10.000 -2.000i
96.000 -40.000i
880.000 -592.000i
10.000 -2.000i
0.534 0.542i
10.000 -2.000i
1.009 -0.086i

10. gonio: sin cos tan asin acos atan
0.541 0.457i
0.500 0.500i
0.990 -0.250i
0.500 0.500i
0.404 0.564i
0.500 0.500i

11. gonio csc sec cot acsc asec acot
1.078 -0.912i
0.500 0.500i
0.950 0.240i
0.500 0.500i
0.839 -1.172i
0.500 0.500i

12. gonio hyperbolicus I
0.457 0.541i
0.500 0.500i
0.990 0.250i
0.500 0.500i
0.564 0.404i
0.500 0.500i

13. gonio hyperbolicus II
0.912 -1.078i
0.500 0.500i
0.950 -0.240i
0.500 0.500i
1.172 -0.839i
0.500 0.500i

.. Complex done
116805
1.000 0.000i
 
 
 */



and Inside the IDE window, click in the upper right Arrow to open a folder Inside this window that you call Complex.h   . Copy and paste Complex.h from the original library inside Complex.h.

Click again in the upper right Arrow and add a new folder Inside Complex.ino that you call Complex.cpp  . Copy and paste Complex.cpp from the original Library Inside Complex.cpp

Then compile, upload and run  Complex.ino on your DUE.

I did a copy of the results at the end of Complex.ino above.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: alcazar_juanc on Jan 25, 2018, 06:12 pm
I tried to upload this Library this way, and I think it works (at least, I have no error at compile time):

Open a new sketch that you can call Complex.ino :

Code: [Select]

//
//    FILE: complex.ino
//  AUTHOR: Rob Tillaart
//    DATE: 2013-09-23
//
// PUPROSE: test complex math
//
// Serial.print(Complex) supported since 0.1.05

#include "complex.h"

void setup()
{
  Serial.begin(115200);
  Serial.print("\n  Complex numbers test for Arduino: ");
  Serial.println(COMPLEX_LIB_VERSION);
  Serial.println("\n1. Print Complex, set, real, imag");

  Complex c1(10.0, -2.0);
  Complex c2(3, 0);
  Complex c3(-10, 4);
  Complex c4(-5,-5);
  Complex c5(0, 0);

  Serial.println(one);
  Serial.println(c1);
  Serial.println(c2);
  Serial.println(c3);
  Serial.println(c4);
  c3.set(0,0);
  Serial.println(c3);
  Serial.println(c3.real());
  Serial.println(c3.imag());

  Serial.println("\n2. ==  != ");
  c5 = c1;
  if (c5 == c1) Serial.println("ok :)");
  else Serial.println(" fail :(");
  c5 = c1 + 1;
  if (c5 != c1) Serial.println("ok :)");
  else Serial.println(" fail :(");
  c5 = 3;
  if (c5 == 3) Serial.println("ok :)");
  else Serial.println(" fail :(");


  Serial.println("\n3. negation - ");
  c5 = -c1;
  Serial.println(c5);
  c5 = -c5;
  Serial.println(c5);
  if (c5 == c1) Serial.println("ok :)");
  else Serial.println(" fail :(");


  Serial.println("\n4. + - ");
  c5 = c1 + c2;
  Serial.println(c5);
  c5 = c1 + 3;
  Serial.println(c5);
  c5 = c1 - c2;
  Serial.println(c5);
  c5 = c1 - 3;
  Serial.println(c5);


  Serial.println("\n5. * / ");
  c5 = c1 * c2;
  Serial.println(c5);
  c5 = c5 * 3;
  Serial.println(c5);
  c5 = c5 / c2;
  Serial.println(c5);
  c5 = c5 / 3;
  Serial.println(c5);

  c5 = c1 / c2 * c2;
  Serial.println(c5);
  c5 = c1 * c4 / c4;
  Serial.println(c5);


  Serial.println("\n6. assign += -= *= /=");
  c5 = c1;
  c5 += c1;
  Serial.println(c5);
  c5 += 3;
  Serial.println(c5);
  c5 -= c1;
  Serial.println(c5);
  c5 -= 3;
  Serial.println(c5);
  c5 *= c1;
  Serial.println(c5);
  c5 *= 3;
  Serial.println(c5);
  c5 /= c1;
  Serial.println(c5);
  c5 /= 3;
  Serial.println(c5);


  Serial.println("\n7. phase modulus polar");
  Serial.println(c1);
  double m = c1.modulus();
  Serial.println(m);
  double p = c1.phase();
  Serial.println(p);
  c5.polar(m, p);
  Serial.println(c5);


  Serial.println("\n8. conjugate reciprocal");
  c5 = c1.conjugate();
  Serial.println(c5);
  c5 = c5.conjugate();
  Serial.println(c5);
  c5 = c1.reciprocal();
  Serial.println(c5);
  c5 = c5.reciprocal();
  Serial.println(c5);

  Serial.println("\n9. power: exp log pow sqrt sqr logn log10");
  c5 = c1.c_sqr();
  Serial.println(c5);
  c5 = c1.c_exp();
  Serial.println(c5);
  c5 = c5.c_log();
  Serial.println(c5);
  c5 = c1.c_pow(2);
  Serial.println(c5);
  c5 = c5.c_sqrt();
  Serial.println(c5);
  c5 = c5.c_sqr();
  Serial.println(c5);
  c5 = c1.c_pow(c2);
  Serial.println(c5);
  c5 = c5.c_pow(c2.reciprocal());
  Serial.println(c5);
  c5 = c5.c_logn(c4);
  Serial.println(c5);
  c5 = c4.c_pow(c5);
  Serial.println(c5);
  c5 = c5.c_log10();
  Serial.println(c5);

  Serial.println("\n10. gonio: sin cos tan asin acos atan");
  c1.set(0.5, 0.5);
  c5 = c1.c_sin();
  Serial.println(c5);
  c5 = c5.c_asin();
  Serial.println(c5);
  c5 = c1.c_cos();
  Serial.println(c5);
  c5 = c5.c_acos();
  Serial.println(c5);
  c5 = c1.c_tan();
  Serial.println(c5);
  c5 = c5.c_atan();
  Serial.println(c5);

  Serial.println("\n11. gonio csc sec cot acsc asec acot");
  c1.set(0.5, 0.5);
  c5 = c1.c_csc();
  Serial.println(c5);
  c5 = c5.c_acsc();
  Serial.println(c5);
  c5 = c1.c_sec();
  Serial.println(c5);
  c5 = c5.c_asec();
  Serial.println(c5);
  c5 = c1.c_cot();
  Serial.println(c5);
  c5 = c5.c_acot();
  Serial.println(c5);

  Serial.println("\n12. gonio hyperbolicus I ");
  c1.set(0.5, 0.5);
  c5 = c1.c_sinh();
  Serial.println(c5);
  c5 = c5.c_asinh();
  Serial.println(c5);
  c5 = c1.c_cosh();
  Serial.println(c5);
  c5 = c5.c_acosh();
  Serial.println(c5);
  c5 = c1.c_tanh();
  Serial.println(c5);
  c5 = c5.c_atanh();
  Serial.println(c5);

  Serial.println("\n13. gonio hyperbolicus II ");
  c1.set(0.5, 0.5);
  c5 = c1.c_csch();
  Serial.println(c5);
  c5 = c5.c_acsch();
  Serial.println(c5);
  c5 = c1.c_sech();
  Serial.println(c5);
  c5 = c5.c_asech();
  Serial.println(c5);
  c5 = c1.c_coth();
  Serial.println(c5);
  c5 = c5.c_acoth();
  Serial.println(c5);

  Serial.println("\n.. Complex done");

  uint32_t start = micros();
  for (int i=0; i<1000; i++)
  {
    c5 = c5.c_csc();
  }
  uint32_t dur = micros() - start;
  Serial.println(dur);
  Serial.println(one);
}

void loop()
{
}
//
// END OF FILE
//
/*  OUTPUT:
 *   
 Complex numbers test for Arduino: 0.1.09

1. Print Complex, set, real, imag
1.000 0.000i
10.000 -2.000i
3.000 0.000i
-10.000 4.000i
-5.000 -5.000i
0.000 0.000i
0.00
0.00

2. ==  !=
ok :)
ok :)
ok :)

3. negation -
-10.000 2.000i
10.000 -2.000i
ok :)

4. + -
13.000 -2.000i
13.000 -2.000i
7.000 -2.000i
7.000 -2.000i

5. * /
30.000 -6.000i
90.000 -18.000i
30.000 -6.000i
10.000 -2.000i
10.000 -2.000i
10.000 -2.000i

6. assign += -= *= /=
20.000 -4.000i
23.000 -4.000i
13.000 -2.000i
10.000 -2.000i
96.000 -40.000i
288.000 -120.000i
30.000 -6.000i
10.000 -2.000i

7. phase modulus polar
10.000 -2.000i
10.20
-0.20
10.000 -2.000i

8. conjugate reciprocal
10.000 2.000i
10.000 -2.000i
0.096 0.019i
10.000 -2.000i

9. power: exp log pow sqrt sqr logn log10
96.000 -40.000i
-9166.244 -20028.609i
10.000 -2.000i
96.000 -40.000i
10.000 -2.000i
96.000 -40.000i
880.000 -592.000i
10.000 -2.000i
0.534 0.542i
10.000 -2.000i
1.009 -0.086i

10. gonio: sin cos tan asin acos atan
0.541 0.457i
0.500 0.500i
0.990 -0.250i
0.500 0.500i
0.404 0.564i
0.500 0.500i

11. gonio csc sec cot acsc asec acot
1.078 -0.912i
0.500 0.500i
0.950 0.240i
0.500 0.500i
0.839 -1.172i
0.500 0.500i

12. gonio hyperbolicus I
0.457 0.541i
0.500 0.500i
0.990 0.250i
0.500 0.500i
0.564 0.404i
0.500 0.500i

13. gonio hyperbolicus II
0.912 -1.078i
0.500 0.500i
0.950 -0.240i
0.500 0.500i
1.172 -0.839i
0.500 0.500i

.. Complex done
116805
1.000 0.000i
 
 
 */



and Inside the IDE window, click in the upper right Arrow to open a folder Inside this window that you call Complex.h   . Copy and paste Complex.h from the original library inside Complex.h.

Click again in the upper right Arrow and add a new folder Inside Complex.ino that you call Complex.cpp  . Copy and paste Complex.cpp from the original Library Inside Complex.cpp

Then compile, upload and run  Complex.ino on your DUE.

I did a copy of the results at the end of Complex.ino above.
In the following link you will find the complex library that works on Arduino DUE, just read the ReleaseNote.txt. Your post @ard_newbie was very helpful to find this compilation mistake.

https://github.com/RobTillaart/Arduino/tree/master/libraries/Complex
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: jlsilicon on Jan 28, 2018, 12:27 am
I noticed that the SERVO and IRREMOTE Librares were mentione earlier here in the Timers Forum for the Arduino DUE.

Has anybody solved the problem with the Conflict with Timer3 between the Servo and IRRemote Libs ?

- I attempted to, but was not successful.

Anybody have a Solution ?
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: jdelcamp11 on Feb 28, 2018, 03:29 pm
I have a library for the adafruit VC0706 camera.
The issue was the Due does not support soft serial. So I simply remove any reference to soft serial.
This may be the problem with many of the compatability issues.
I know there is a better way to do this, using "if architecture SAM3X". But this worked for me.
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: zahraali079 on Apr 08, 2018, 07:06 pm
i included 2 libraries of  arduino due using (plc + schduler ) plc lib all functions was working properly but when adding shduler library the code complied normally but when i go to see result only first loop that fundtion in board due and stoped other loops don't work
Title: Re: Arduino Due libraries (official and 3rd party)
Post by: nitrof on Apr 09, 2018, 01:48 am
Hi zahraali079.

First, to reach more people to help you, you should start a new tread.

Second, provide your code.

Regards. Nitrof