Arduino 0011 released.

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! :wink:
The upload sketches too.

I erased the chip with -e command, and then uploaded a sketch without the bootloader using these (DOS) commands:

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?

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?

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!

Awesome. Thanks for trying it out!

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

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:

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

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

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>

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.

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

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.

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.

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

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

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.

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.

I agree with this, the language has a proper flow to it, and when you start adding macros to make it look like something else, you make it harder to get a true feel for the langue.

Please forgive my ignorance, but all I want is for this:

TCCR1A = 242;
TCCR1B = 25;
ICR1 = 1023;
DDRB = _BV(PB1) | _BV(PB2);

...to work again. What do I need to do?

Thanks!

monk_tavern: you might be better off making a separate post (in a different category) with more details. What are you trying to do? When did it work? What happens now?

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

Not learning how to cast is not a good idea.

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.

Is this in reference to the Alpha version only, and not the full release?

I'm using the 0012 IDE and there is still a problem with this.

Supposedly it was fixed, but that does not seem to be the case. How about just undoing whatever it was that broke casting? Trying to insulate new folks from casting is just not the right way to go.

I think doing this is just going to far to keep newbies from having to learn more of the real C/C++ language. Casting is not that difficult to deal with.

8-Dale