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?
The library is linked at the bottom of the post that you quoted.
Look for this - pwm01.h (3.96 KB - downloaded 338 times.)
Hi,
Has anyone got the due working with SDI-12 library that is made available by stroudcenter. Github repo is:
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!
My own Due library for ILI9341 SPI displays:
Forum:
http://forum.arduino.cc/index.php?topic=265806.0
Github:
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?
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.
rfm73.cpp (25.5 KB)
rfm73.h (11.4 KB)
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.
WebServer.zip (119 KB)
Serial library using DMA. Needs more testing, as far I can tell though it works.
rblilja:
Serial library using DMA. Needs more testing, as far I can tell though it works.GitHub - rblilja/DmaSerial: Serial library utilising DMA on the SAM3X8E MCU (Arduino Due).
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.
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..
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:
avr/io.h: No such file or directory
#include <avr/io.h>
or if i use a clock:
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???
Finally succeeded to modified Adafruit RGB panel library for 16x32 rgb panel to suit arduino due.
I found it at here and it worked : https://codeload.github.com/enternoescape/Arduino-IRremote-Due/zip/master
how i can interface arduino due with HC05 bluetooth module.....
i was doing but there was no response with due....
The MIFARE MFRC522 library works properly with arduino due.
The SPI ports have to be used for interfacing.
I have created MIDI USB Library for Arduino Due.
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
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
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