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?

Jim
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 http://arduino.cc/en/Reference/HomePage, 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.

HTH
Jim


#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()
{
   Serial.begin(115200);
   Serial.println("Blink");
   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);
   delay(100);
   digitalWrite(ledPin, LOW);
   delay(900);

   count++;
}
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?

Jim


 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

THEN MORE IN EACH OF THE FOLLOWING LIBRARIES:

 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

AND MORE UNDER:

 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.

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

    C:\Users\xxxxx\Downloads\Arduino\arduino-1.5.1r2-windows\arduino-1.5.1r2\

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.

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

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.

    \hardware\tools\avr\avr\include\avr

   Does this help?
   Jim


 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.

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

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

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

http://arduino.cc/en/Main/ArduinoBoardEsplora

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

    BOARD_ARDUINO_MEGA
    BOARD_ARDUINO_DUE

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

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

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

http://www.eetimes.com/electronics-blogs/maxs-cool-beans-blog/4217647/IPv4--IPv6--The-Internet-of-Things--6LoWPAN--and-lots-of-other--Stuff-  (see the bit about 'SNAPpy')

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

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.

BW
Jim
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.

http://wiki.python.org/moin/EmbeddedPython
http://wiki.python.org/moin/PyMite
http://atmega32-avr.com/using-atmega16-micrcontroller-running-python-pymite-09-on-an-arduino-mega-2560/

Jim
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 http://justsnippets.blogspot.com/2011/06/arduino-triggered-function-generator.html, in case it helps anyone.

Jim
Pages: 1 2 [3] 4