Arduino Due libraries (official and 3rd party)

Adafruit lib for NeoPixel works fine

(tested with 10 pixel of the stripe Adafruit NeoPixel Digital RGB LED Strip - White 60 LED [WHITE] : ID 1138 : $99.80 : Adafruit Industries, Unique & fun DIY electronics and kits)

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)

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 Slow Clock External Crystal is Not Used - BUG - Suggestions for the Arduino Project - Arduino Forum it is very easy to turn on.

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. New Arduino Due Library: DueEEPROM - Libraries - Arduino Forum

any1 have library for DUE work with DHT22?

MINMSC driver is posted for Due :-

README.txt 2 KB

minmsc_2013_11_17_v1_0.zip 9.8 MB

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.

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

Source Code:
minmsc_2013_11_27_v1_1.zip 90 KB

Just Documentation:
minmsc_doc_2013_11_27_v1_1.zip 9.7 MB

Regards.

Alexeyca:
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 - Arduino Playground - DHTLib -

kmartburrito:
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

Cheers!

http://forum.arduino.cc/index.php?topic=164281.msg1539562#msg1539562

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?

randomvibe:
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:

#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!

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

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

AccelStepper.h for stepper control of position, speed and acceleration:

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

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

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

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

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.

SimpleModbusSlave_DUE.zip (145 KB)

SimpleModbusSlave_DUE_fonc.zip (149 KB)

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/. 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.

I have successfully tested this Button Library:

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.

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 GitHub - McNeight/CAN_Library: Multiplatform Arduino library for supporting the native CAN controller on Due (SAM3X) and Teensy 3.1 (K2X) as well as MCP2515 through SPI

Comments and patches are more than welcome.

-Neil

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.

randomvibe:
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:

#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?