Using the busy flag for the LCD is an interesting idea. I think the implementors of the original library avoided it because you can save a pin (I think) by tying the read / write flag to ground (or 5v?) rather than controlling it explicitly. I'd definitely like the library (and the rest of the core) to work at 20 MHz. Actually, if you find things in the Arduino core that don't work at 20 MHz, please let me know, as I'd like to support for that CPU speed. Patches are even better of course. For the moment, though, I'm not so concerned about the speed of the library, since we can only read text so fast anyway. But if it's a problem for people, we can certainly look into supporting the busy flag.
This approach was chosen so that buzzer operation would rely solely on timer1, but if you are serious about making this a standard library, it might make more sense to drive buzzer operation with the timer0 overflow interupt used for millis().- Ben
If you're bored and wanted to generalize it to any CPU speed (or at least 16 MHz and possibly 8 MHz), that would be awesome. Otherwise, I'll give it a shot. We need more people playing Bach with Arduino!
For the moment, though, I'm not so concerned about the speed of the library, since we can only read text so fast anyway. But if it's a problem for people, we can certainly look into supporting the busy flag.
We've been avoiding printf() and co. because the syntax is relatively complicated compared to the rest of the Arduino API. Also, they can take up significant program space (1.5 KB or so, if I remember right, which was a lot when we were using the ATmega8).
We just had a local robot competition today, and a few of us at Pololu made entries out of a new robot kit we are developing that is essentially a higher-voltage version of the Orangutan LV-168 layed out as a PCB chassis. A few of us made ours using the Arduino IDE and the Orangutan Arduino libraries (it worked great and I was very happy with the experience), and a few of us used AVR Studio with C version of the same libraries. The allure of the new buzzer library was so strong that one person had his robot playing Bach's Fugue as it did its line-following and maze-solving, and another had his line-follower speed synchronized to a Hungarian Rhapsody.
The following picture shows a piezo buzzer playing a melody from program memory.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16