Show Posts
Pages: 1 ... 29 30 [31] 32 33 ... 41
451  Development / Suggestions for the Arduino Project / Re: Arduino 1.0 IDE Compatibility with previous versions on: December 11, 2011, 01:53:56 pm
So libraries form 022 are obsolete in 1.0 and we must wait for new versions or try to modify them ?

Yes, exactly.

But the libraries that come with Arduino, and many of the major libraries, have already been updated.  I updated OneWire a couple weeks ago, and PS2Keyboard many months ago.  I've sent patches to a several library authors.  I'm planning to work on IRremote next week.
452  Development / Suggestions for the Arduino Project / Re: Arduino 1.0 IDE Compatibility with previous versions on: December 10, 2011, 06:22:29 pm
The Arduino Team considered including a WProgram.h, but ultimately they decided against it:

http://code.google.com/p/arduino/issues/detail?id=609

Personally, I would not have made that choice.  In Teensyduino, I kept WProgram.h and also added Arduino.h, so either new or old libs can work.

"RTFM" seems a bit harsh.

I don't like seeing people suffering compatibility issues (which is why I kept WProgram.h and went to a lot of effort for backwards compatibility in Teensyduino).  But what ships in the official Arduino isn't up to me.
453  Development / Suggestions for the Arduino Project / Re: Other CPU frequencies support (4MHz, 2MHz, etc) on: December 09, 2011, 05:18:51 pm
In Teensyduino, I implemented a Tools > CPU Speed menu.  The crystal is always 16 MHz, but selecting something other than 16 (eg, 8, 4, 2, 1) reconfigures for that speed using the on-chip clock prescaler.  Teensyduino has delayMicroseconds(), delay(), millis(), and micros() (and also extensions elapsedMillis and elapedMicros) that work at those 5 speeds.  It also has speed-dependent initialization of the PWM and ADC clocks so they work as expected at all speeds.

Do don't need to buy a $16 Teensy to get this code (but of course, I wouldn't mind if you did... all this software development is funded by Teensy sales).  The Teensyduino installer is a free download. After you run the installer, Teensyduino's core is placed in your Arduino, in hardware/teensy/cores/teensy (on a Mac, control-click and choose "show package contents").  Inside you can find this code, and probably even get much of it to compile and work pretty easily on an Arduino Uno.  The delayMicroseconds() function, while built from a lot of optimized inline assembly, should be fairly self-contained and ought to work on any AVR chip.

The code in the IDE which implements the CPU Speed menu was contributed as a patch over 1 year ago.  Sadly, it never was included in Arduino.

http://code.google.com/p/arduino/issues/detail?id=257
454  Development / Suggestions for the Arduino Project / Re: Arduino 1.0 produces 25% larger binary? on: December 08, 2011, 02:55:20 pm
However, looking at the notes about 1.0, there was a useful looking library for parsing text and data from character stream, and changing the data type in one go.

Would it be wasting my time to see if this library work in 0022 ?

Maybe you're thinking about the new Stream functions?  They're find(), findUntil(), parseInt(), parseFloat(), readBytes(), readBytesUntil()... and you can use with the Serial, Ethernet's Client, and other interfaces that inherit the Stream API.  I believe they were original written/contributed Michael Margolis.  I submitted a few minor bug fixes while 1.0 was in development.

These are pretty easy to back-port to Arduino 0023.  I believe you can just copy Stream.cpp into the core, and then edit Stream.h to add the extra definitions.  I did this in Teensyduino's core, so these all work on 0022 and 0023 on Teensy.  I haven't tested on Arduino, but if simply copying the .cpp and merging the .h doesn't work, you could always run the Teensyduino installer and look at my code to help resolve any problems.

455  Development / Suggestions for the Arduino Project / Re: Arduino 1.0 , Is it the Arduino Team's "Vista"? on: December 08, 2011, 02:38:05 pm
In Teensyduino I implemented a lot of backwards compatibility.  It's really not that difficult, if you care about compatibility.  It's not a lot of complex code

Nearly all pre-1.0 code compiles and works as intended when run on 1.0, at least when using a Teensy board (Teensyduino tries to never interfere with Arduino's behavior on Arduino boards).  I also back-ported most of the new 1.0 features to 0023 and 0023, again, only when compiling for a Teensy board.

I'd be happy to contribute this code, if the Arduino Team seriously wants it.  Or if anyone is interested, you can help yourself.  It's all sitting there in the hardware and libraries dirs after running the Teensyduino installer.  For example, Wire.h is patched with inline compatibility functions.  They're protected by #ifdef so as not to alter anything on Arduino boards.  Just delete that #ifdef check, and sketches using the pre-1.0 Wire lib work fine on Arduino boards too.

Of course, the re-purposing of Serial.flush() and change for print(unsigned char) to print as base-10 integers don't seem to have any compatibility solution.  But most of this stuff is pretty straightforward... and the solutions already exist.

456  Development / Suggestions for the Arduino Project / Re: Arduino 1.0 produces 25% larger binary? on: December 03, 2011, 11:34:20 am
I also might investigate, but at the risk of repeating myself, it's pointless without having the code to reproduce the problem.

@barish - you posted your sketch, but that is not enough.  Imagine, if you will, that you some random person who might help, but has nothing other that a clean copy of the Arduino IDE.  Try downloading a fresh copies of Arduino, both 1.0 and 0023.  Can you reproduce the exact result in both using only fresh downloads of both Arduino IDEs, and the files you've provided?  If not, you haven't posted enough to reproduce the problem!
457  Using Arduino / Installation & Troubleshooting / Re: I think deleting WProgram.h was a bad idea on: December 03, 2011, 09:00:43 am
I personally didn't like the decision to completely remove WProgram.h.  It's easy to keep a WProgram.h which merely includes Arduino.h.  I've done this and much more in my support for Teensy (see below).  Ideally, a warning would be printed if WProgram.h is used, but that's not so easy since gcc is run with "-w", so #warning does not work in Arduino.

Clearly keeping a WProgram.h was considered:

http://code.google.com/p/arduino/issues/detail?id=609

I think a bigger problem is that the 4 beta tests and 2 release candidates were never widely available.  Unless you follow the developer mail list, which is often has a high ratio of chatter about coding philosophy to actual people working on real code, you probably never would have known about these 6 releases over the last several months.  Their purpose was to give people time to adapt to 1.0's changes.  But not showing them on the main download page kept them in relative obscurity.

Then again, I've exchanged messages with several library authors over the last year.  The general sentiment was to not worry about porting to 1.0 until it was official.  So perhaps no amount of pre-release access would have helped?

In Teensyduino, I added as much backwards compatibility as possible.  Both WProgram.h and Arduino.h work in both 0023 and 1.0.  print(n, BYTE), Wire's original functions, and many other little things all work perfectly in 1.0.  At least they do on Teensy, where I can publish an alternate core.  I have no control over Arduino.  Even the patches I contribute only seem to get used when they're small bug fixes.

Another very unfortunate issue (which was reported to me only yesterday... I working on a fix now) involves the naming of Udp in Arduino 1.0.  If you try to make a core library that is compatible with both new and old sketches and libraries (maybe I'm the only person crazy enough to attempt that?), the fact that these headers with the same names as 0023's ethernet library are now part of the core library is a major headache.  There does not seem to be any solution using only the compiler's preprocessor, because of the way the include paths are built.  My next update to the Teensyduino installer will include a check for these when installing on 0022 or 0023.

If there's interest from the Arduino Team to provide backwards compatibility with 0023 in the next release, I will certainly contribute patches.  I've already solved almost all the compatibility issues that prevent code designed for 0023 from working on 1.0.  I've also managed to back-port nearly all 1.0 features to 0023.  It's really not that difficult... if you care about preserving compatibility.

Of course, there are a couple 0023->1.0 compatibility issues are impossible by design, like the intentionally different function of Serial.flush() and Serial.print() using unsigned char printing as base 10 number instead of a single byte.
458  Development / Suggestions for the Arduino Project / Re: Compile Speed - testing & feedback needed! on: December 02, 2011, 10:30:10 am
Certainly there are much more urgent things than compile speedup.  Issue 527, for example.

It definitely is frustrating to see patches go unused.  I would contribute a LOT more if my existing patches were used, and Arduino in general had an openness towards contributions that was reflected in the actual usage of patches people submit.  I'm imagine quite a few other people, some of whom I know have utterly given up on contributing to Arduino.

On unused patches, I'd like to remind you about the one I submitted on issue 550.  You wrote "patches welcome" in October.  I submitted the patch 2 days later, and an improved patch after another 3 days (based on some user feedback from the first).  It has now sat for a full month.  Will it ever get used?

Especially when you say "patches welcome", but then you don't use them, that is really disheartening to contributors.

Another perfect example is "menu cleanup" (issue 257), which has sat unused for over 1 year!  I never expected my original patch to be used.  But then in November (1 year ago) you specifically asked me to completely rework the boards.txt syntax.  I did, and submitted a completely new patch within a week.  It was a substantial amount of work.  Why would you ask me to do all that work, but then never use it?

Still, I have at least a few more patches heading your way soon.  They're all little things recently discussed on the developer mail list.  I'm reluctant to submit any more "big" patches.
459  Development / Suggestions for the Arduino Project / Re: Arduino 1.0 produces 25% larger binary? on: December 02, 2011, 07:51:38 am
OneWire 2.1 has an option, if you edit OneWire.h, to use a small but slower CRC algorithm.  For OneWire 2.0, the slow code was the default.  2.1 defaults to the fast code.  The size change should be about 250 bytes.

Unfortunately, some of 1.0's new features, like xyz.print() returning byte counts, simply consume more code space.

If you had posted code, I might have investigated if any one thing was a huge contributor to the size change.  But instead, I'm writing this message..  (hint: your chances of more useful help are always better if you post code that demonstrates your problem).
460  Development / Suggestions for the Arduino Project / Re: Compile Speed - testing & feedback needed! on: November 30, 2011, 10:30:50 pm
Maybe now that Arduino 1.0 is finally released, hopefully they'll have more time to look at "post-1.0" contributions like this speedup?
461  Development / Suggestions for the Arduino Project / Re: Include file is not parsed on: November 21, 2011, 02:59:21 pm
Maybe this is the perfect opportunity (or motivation) for you to dig into the java code?

Arduino already parses the #include lines from the .pde files, to produce the list of libraries that need to be compiled.  So the "hard work" is already in there.  Code also already exists to build a list of all the .c and .cpp files.

Of all the possible IDE contributions, this one is probably one of the easiest for a beginner to make a significant contribution.
462  Development / Suggestions for the Arduino Project / Re: Include file is not parsed on: November 20, 2011, 03:10:01 pm
I believe this is issue 236.

http://code.google.com/p/arduino/issues/detail?id=236

It's marked as accepted for 1.0, but nobody seems to have actually worked on it (yet).
463  Development / Suggestions for the Arduino Project / Re: More Arduino 1.0 issues on: November 20, 2011, 03:07:57 pm
Maybe there's something not quite right about the 1.0-rc2 headers, since it works if you include them in one order, but not in another?

If you send me the code which produces all those errors, I'll investigate.  Please email me directly, paul at pjrc dot com.

464  Development / Suggestions for the Arduino Project / Re: Command-Line Usage? on: November 19, 2011, 02:19:53 pm
this would seem to be a prime candidate to split this out from the Java IDE into a make file;

Yes, indeed.  This idea has been brought up over and over again.  It has been consistently rejected by the Arduino Team.

The reason cited has usually been the necessity of including (and maintaining) more binary tools in the distribution.  Currently there are 2: the avr toolchain and avrdude.  Not only would the make binary need to be included, but so would something that can do the preprocessing step.  Make can not do it alone.  Some other parsing tool besides make (eg, perl) would also need to be in the distribution.

Reimplementing the preprocessing step without java is really the thorny issue.  All the .pde files are concatenated together.  Then a regex-based parser finds the functions and adds prototypes, and adds an include.  It also discovers which libraries are used, based on the includes the user wrote.  This information from parsing must be fed back into the build process to create the correct dependencies and include paths.

Numerous makefiles have been created to mimic the Arduino build.  Most of the makefiles have not been maintained well as Arduino has changed its build process.  But none, at least that I've seen, completely reproduce the exact Arduino build with preprocessing.  Faithfully reproducing the exact build process is not so simple.  It can be done.  Maybe it has, but I just haven't seen it?

But regardless, the Arduino Team has said very clearly, many times, that Arduino will not switch to using make for its build process.

465  Development / Suggestions for the Arduino Project / Re: Arduino Pro Mini + 1.0 RC2 + RF24 on: November 14, 2011, 05:41:14 pm
Arduino 1.0 renamed the header files, which breaks nearly all 3rd party libraries.

Usually replacing any includes of WProgram.h with this solves the problem:

#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
Pages: 1 ... 29 30 [31] 32 33 ... 41