Go Down

Topic: Arduino 0011 released. (Read 3123 times) previous topic - next topic

mellis

Arduino 0011 is now available: Windows, Mac OS X, Linux.  

Changes include:

* Improved reliability for uploading to Arduino BT.
* Better support for bootloader burning with a parallel programmer.
* Fixed Find in Reference.
* Added map() function for mapping values from one range to another.
* Added analogReference() function.
* Added interrupts() and noInterrupts() functions.
* Added degrees() and radians() functions.
* Added timeout parameter (in microseconds) to pulseIn(); default is 1 second.
* Support for uploading sketch using a programmer.
* Improved detection of functions that need prototyping.
* Placing function prototypes after #include's and #define's.
* No longer moving #include statements to the top of the sketch.
* Can now drag .pde files onto the Arduino dock icon on Mac OS X.
 Thanks to Peter Sgouros.
* New script for downloading the reference from Tom Pollard.  Thanks Tom!
* Miscellaneous Mac OS X and other patches from Wim Lewis.  Thanks Wim!
* Updated Mac OS X FTDI drivers.


Updates to the reference and other documentation will follow in the next few days.

Adilson Akashi

I'm downloading it right now, and if I have some kind of problem, I'll tell you.

I will test it with XP SP2 and Win98, and serial arduinos.
PCB Designer

Adilson Akashi

Mellis,

The bootloader in this version is working fine with old serial board and severino (no more 10 min. delay or older versions needed). Thanks! ;)
The upload sketches too.

I erased the chip with -e command, and then uploaded a sketch without the bootloader using these (DOS) commands:
Code: [Select]
avrdude -Cc:\arduino-0011-win\arduino-0011\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pm8 -cdapa -b115200 -e

avrdude -Cc:\arduino-0011-win\arduino-0011\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pm8 -cdapa -b115200 -D -Uflash:w:c:\arduino-0011-win\arduino-0011\examples\Digital\Blink\applet\Blink.hex:i


And I did a test with IDE 0010, with the same commands, and it worked too! The sketch starts without the 10 sec. delay in both cases. Is this strange with 0010?
Code: [Select]
avrdude -Cc:\arduino-0010-win\arduino-0010\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pm8 -cdapa -b115200 -e

avrdude -Cc:\arduino-0010-win\arduino-0010\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pm8 -cdapa -b115200 -D -Uflash:w:c:\arduino-0010-win\arduino-0010\examples\Digital\Blink\applet\Blink.hex:i



And how can we do this using IDE? I've tried using the old process (http://www.arduino.cc/en/Hacking/Programmer) but the 0011 IDE seems to bypass the preferences.txt file. I saw you said "it will return in a different form", so how can we do the trick?
PCB Designer

Adilson Akashi

#3
Mar 29, 2008, 05:34 am Last Edit: Mar 29, 2008, 08:24 pm by adilson Reason: 1
Ok, you don't have to answer the last question. I saw your recent changes in http://www.arduino.cc/en/Hacking/Programmer

and I tested it, changing upload.using from bootloader to parallel and sketch was uploaded without problems with IDE! This is very useful! Mainly for Atmega8, with low mem space. And no bootloader  to sketch delay!
PCB Designer

mellis

Awesome.  Thanks for trying it out!

Oracle

Is this just a new IDE or a new firmware that would have to be flashed?

mem

The changes to the auto prototyping logic seem to have fixed all the bugs in this area that I had reported. Many thanks for fixing this.

One strange thing I have noticed is that sketches that include stdio.h now compile with a series of errors such as this:
 c:/got/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:263: error: expected unqualified-id before 'int'

You can reproduce the problem by compiling the following sketch:

Code: [Select]

#include <stdio.h>
void setup() {
}
void loop(){
}


BTW, would you prefer bug reports here or in Software/bugs & suggestions

mellis

Either place is fine.

This bug is caused by the new function-like casts that I added to Arduino 0011 for consistency with Processing and Wiring (and to avoid having an extra kind of syntax).  That is, you can say:

byte b = 5;
int x = int(b);

Unfortunately, this interferes with places where int is used as the return type of a function pointer, as in stdio.h:

     int      (*put)(char, struct __file *);      /* function to write one char to device */

To work-around the problem, you can put:

#undef int()

before the:

#include <stdio.h>


mem

Thanks for the work around, that does fix the stdio.h problem.

BTW, are you aware that stdio.h is included in wiring_private.h so anything that includes that header will generate the error.    Not sure why its included, but removing stdio.h from  wiring_private.h may be something to consider for the next release.


byte b = 5;
int x = int(b);
in the  example you posted , the standard C cast would work, I am curious to see an example where the cast would not work, could you point me to a processing fragment that demonstrates the problem.

Bryan

Wow, I really love it. Great works!
Success rate for my ArduinoBT uploading is greatly improved even with my slow-reaction button-pressing.

Thanks a lot

mellis

A cast would work just as well, but it's an extra syntax for people to learn.  By including a function-like macro that does the same thing, people can use the syntax they already know.

mem

I am unclear on the impact of the work-around. If the macro was needed in a sketch then would there be a compile problem if the work-around was used in that sketch?

I guess I am having trouble seeing where the macro would be needed. Perhaps an example illustrating the issue the new macro addresses would help to make things clearer.

mellis

The macro is need any where you would have previously used as a cast.  It allows people to avoid learning the cast syntax.

mem

Code: [Select]

#define int(x)     ((int)(x))
#define char(x)    ((char)(x))
#define long(x)    ((long)(x))
#define byte(x)    ((uint8_t)(x))
#define float(x)   ((float)(x))
#define boolean(x) ((uint8_t)((x)==0?0:1))



I had a look at the new wiring.h and it appears that there will also be a problem with function pointers that return: char, long, byte, float and boolean.

This may well be a reasonable trade-off but I am struggling to think of an example where these macros would be helpful. Could you humor me and point me towards an example that requires one of these macros.

MysteriousAges

Quote
The macro is need any where you would have previously used as a cast.  It allows people to avoid learning the cast syntax.

I think I can see where you're coming from, trying to make things easier for newbies, but I think the casting syntax isn't that complicated that it should need a macro.

Are there any intro-level tutorials for writing C/C++ on the Arduino on the site anywhere? Perhaps if there were some basic C tutorials available, macros like this wouldn't be needed, as the tutorials should cover basics like casting.

Go Up