Show Posts
Pages: 1 2 [3] 4
31  Products / Arduino Due / Re: PWM Pins don't work on: December 22, 2012, 07:40:34 am
Hi Mark,

Could you show us the siimplest sketch that doesn't work please?

32  Products / Arduino Due / Re: square and itoa dont work on ARDUINO DUE on: December 22, 2012, 06:29:50 am
There's no mention of a square function in the Arduino reference at, but it's easy enough to define a C macro to do it.

An itoa function is available if you #include the file itoa.h.

The sketch below uses itoa and square and works as expected with a Due and Arduino 1.5.1r2.


#include "itoa.h"
#include "Print.h"

template<class T> inline Print &operator <<(Print &obj, T arg) { obj.print(arg); return obj; }
#define square(x) pow(x, 2)

int count = 1;
int ledPin =  13;    // LED connected to digital pin 13

// Run once, when the sketch starts.
void setup()
   count = 0;

   // initialize the digital pin as an output:
   pinMode(ledPin, OUTPUT);     

void loop()                     
   String s;
        char temp[20];

   Serial << "Blink: Loop " << count << ", " << itoa(count, temp, 10) << ", " << square(count) << (char)10;

   digitalWrite(ledPin, HIGH);
   digitalWrite(ledPin, LOW);

33  Products / Arduino Due / Re: Library Problem With IDE V1.5.1r2 And Due on: December 20, 2012, 11:31:09 am
Hi Eddie,

Re-reading your posts, I think the problem is just down to the difference in architecture between the Due (ARM based - "Atmel SAM3X8E ARM Cortex-M3") and the earlier Arduino boards (AVR based, e.g. ATmega2560).  When you compile for the Due it's using the files under hardware\arduino\sam, and there's simply no header file called io.h.

I've listed all the available header files under hardware\arduino\sam below.

The Due requires various libraries to be re-written or 'ported' to it, and it would be fantastic if someone with more knowledge than me could list what's available and what isn't (yet) - any volunteers please?


 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\cores\arduino

06/11/2012  12:02             4,756 Arduino.h
06/11/2012  12:02            10,379 binary.h
06/11/2012  12:02               697 Client.h
06/11/2012  12:02             1,325 HardwareSerial.h
06/11/2012  12:02             2,978 IPAddress.h
06/11/2012  12:02             1,264 itoa.h
06/11/2012  12:02             2,505 Print.h
06/11/2012  12:02             1,335 Printable.h
06/11/2012  12:02               956 Reset.h
06/11/2012  12:02             1,353 RingBuffer.h
06/11/2012  12:02               111 Server.h
06/11/2012  12:02             4,005 Stream.h
06/11/2012  12:02             1,731 syscalls.h
06/11/2012  12:02               854 Tone.h
06/11/2012  12:02             1,785 UARTClass.h
06/11/2012  12:02             4,180 Udp.h
06/11/2012  12:02             1,795 USARTClass.h
06/11/2012  12:02             4,769 WCharacter.h
06/11/2012  12:02             1,080 WInterrupts.h
06/11/2012  12:02             2,310 wiring.h
06/11/2012  12:02             2,094 wiring_analog.h
06/11/2012  12:02             2,614 wiring_constants.h
06/11/2012  12:02             2,729 wiring_digital.h
06/11/2012  12:02             1,083 wiring_private.h
06/11/2012  12:02             1,307 wiring_pulse.h
06/11/2012  12:02             1,157 wiring_shift.h
06/11/2012  12:02             1,147 WMath.h
06/11/2012  12:02             8,489 WString.h
              28 File(s)         70,788 bytes


 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\cores\arduino\USB
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\firmwares\atmega16u2\arduino-usbserial
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\firmwares\atmega16u2\arduino-usbserial\Board
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\firmwares\atmega16u2\arduino-usbserial\Lib
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\libraries\Audio
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\libraries\Ethernet
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\libraries\Ethernet\utility
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\libraries\Scheduler
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\libraries\SPI
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\libraries\USBHost
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\libraries\Wire


 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\system
 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\arduino\sam\variants
34  Products / Arduino Due / Re: Library Problem With IDE V1.5.1r2 And Due on: December 20, 2012, 08:09:03 am
I know your sketch is complex, but could you possibly pare it down to a minimum (that fails) and post it here please?

I'll have a look.

35  Products / Arduino Due / Re: Library Problem With IDE V1.5.1r2 And Due on: December 20, 2012, 02:53:16 am
What's the location of the Arduino.exe you're running to get 1.5?

From what you've said, I reckon it should be:


If that's where the exe is, maybe check your desktop shortcut (f that's what you're using) - the target and start folder should be:

Target:    "C:\Users\xxxxx\Downloads\Arduino\arduino-1.5.1r2-windows\arduino-1.5.1r2\arduino.exe"
Start in:     "C:\Users\xxxxx\Downloads\Arduino\arduino-1.5.1r2-windows\arduino-1.5.1r2"

Personally I would make a copy somewhere else, e.g. under Program Files, so that you can do whatever you like in your Downloads folders, e.g. delete them all if necessary sometime.

36  Products / Arduino Due / Re: Library Problem With IDE V1.5.1r2 And Due on: December 19, 2012, 01:45:36 pm

I generally copy the Arduino 'tree' for each new version to a subfolder of a Program Files folder, so I now have several copies of that file.  The bottom two in the listing below show both 1.0.3 and 1.5.1r2 as having the file in the same relative location, i.e.


   Does this help?

 Directory of F:\Program Files\Arduino\Arduino ERW 1.0.3\hardware\tools\avr\avr\include\avr

09/01/2010  21:03            14,436 io.h
               1 File(s)         14,436 bytes

 Directory of F:\Program Files\Arduino\arduino-0018\hardware\tools\avr\avr\include\avr

04/12/2008  21:36            11,481 io.h
               1 File(s)         11,481 bytes

 Directory of F:\Program Files\Arduino\arduino-0022\hardware\tools\avr\avr\include\avr

04/12/2008  21:36            11,481 io.h
               1 File(s)         11,481 bytes

 Directory of F:\Program Files\Arduino\arduino-0023\hardware\tools\avr\avr\include\avr

04/12/2008  21:36            11,481 io.h
               1 File(s)         11,481 bytes

 Directory of F:\Program Files\Arduino\arduino-1.0\hardware\tools\avr\avr\include\avr

04/12/2008  21:36            11,481 io.h
               1 File(s)         11,481 bytes

 Directory of F:\Program Files\Arduino\arduino-1.0.1\hardware\tools\avr\avr\include\avr

04/12/2008  20:36            11,481 io.h
               1 File(s)         11,481 bytes

 Directory of F:\Program Files\Arduino\arduino-1.0.2\hardware\tools\avr\avr\include\avr

04/12/2008  21:36            11,481 io.h
               1 File(s)         11,481 bytes

 Directory of F:\Program Files\Arduino\arduino-1.0.3\hardware\tools\avr\avr\include\avr

04/12/2008  21:36            11,481 io.h
               1 File(s)         11,481 bytes

 Directory of F:\Program Files\Arduino\arduino-1.5.1r2\hardware\tools\avr\avr\include\avr

04/12/2008  21:36            11,481 io.h
               1 File(s)         11,481 bytes

37  Topics / Science and Measurement / Re: analog outputs on: December 12, 2012, 04:15:38 am
The recently-released Arduino Due has DACs / analog output.  You'd probably need some external level shifting / amplification as well, e.g. one op-amp.

38  Products / Arduino Due / Re: Why use a RTOS? on: December 11, 2012, 07:21:52 am

Yes please!  Well done on pushing the boundaries forward.  I'm certainly interested in more reliable, fast methodologies.

39  Products / Arduino Esplora / New board! on: December 11, 2012, 07:14:07 am
Arduino Esplora announced!

40  Development / Other Software Development / Re: BOARD preprocessor directives from IDE on: December 11, 2012, 06:55:03 am
I agree with craiglindley, this would be very useful.

Other people have talked about #defines like:


Do they exist, or are there any plans to add them?  Can pYro_65's approach be used to uniquely identify a board product?

41  Products / Arduino Due / Re: Due External Interrupts on: December 07, 2012, 02:12:36 pm
I think that capacitor value is too low, and also the parallel resistor could be higher, e.g. 10K.  You've got a very short time constant at the moment.

You could also use a software debounce.

How about adding:

  volatile int bCount = 0;

at the top, incrementing it in b_func, and printing it each time you print "b true"?  Might give some insight about the interrupts.

42  Products / Arduino Due / Re: Python for Arduino Due on: November 01, 2012, 10:21:31 am
For anybody interested, there's a very interesting use of Python 'close to the metal' at:  (see the bit about 'SNAPpy')

43  Products / Arduino Due / Re: StandardFirmata on Due on: October 31, 2012, 01:13:13 pm

Maybe you're feeling extra grumpy, but how can you ignore all the folk who occasionally want an easy way to test their board, often because the 'super fast many-interrupt native app' they're trying to get going isn't quite there yet?  Anyone ever thought they've bricked a board?

I think we need more ways to test kit and help beginners to develop their confidence, not fewer.

44  Products / Arduino Due / Re: Python for Arduino Due on: October 30, 2012, 08:50:46 am
There's really no hard boundary between 'scripting' and 'programming' languages, and python certainly has other uses than scripting.  Personally I'm sure that python will find its way to the Arduino world and have its place, just as it has with .NET.  There's too much goodness now in the 'py world' for this not to happen.

People always worry about scripting performance, but the worry tends to go away over time - most folk don't have to worry any more about JIT compilation and the like with Java and the .NET languages.  Obviously you wouldn't want to use an interpreted language for device control, tight timing loops and interrupt routines, but for higher layers it could be very useful if there's room for the (normally) C-based engine.

45  Community / Exhibition / Gallery / Triggered Function Generator (Arduino Mega) on: July 09, 2011, 03:12:20 am
I've posted some code and screenshots for a triggered function generator (presently just a delayed pulse, but could be anything) at, in case it helps anyone.

Pages: 1 2 [3] 4