I just released the latest Antipasto Arduino for Windows, Linux, and Mac OS X x86. The IDE is available for download on illuminatolabs.
Along with a number of code "housekeeping" updates, there were a couple larger changes:
- Fixes for Gadget File loads and board switches (issue #3, issue #4 , issue #7) Thanks Joao!
- New TouchShield TButton library and ButtonDialog example sketch for that library
Chris added the TButton library after several people asked about projects that use the TouchShield Slide as a menu system. Writing code for custom touchscreen buttons was part of what made the TouchShield so useful (instead of having real buttons), and it was actually something that came up quite some time ago. Actually, Matt and I remixed the original BitDJ code to create a TouchShield app to make breakfast.
Here’s the simple ButtonDialog example I’ve included:
And this is the code:
#include <TButton.h>
TButton ok = TButton("Ok",20,80);
TButton cancel = TButton("Cancel",80,80);
void setup() {
ok.Paint();
cancel.Paint();
}
void loop() {
if (ok.GetTouch()) {
stroke(255);
fill(0);
text("Pressed 'Ok' ", 10, 30);
}
if (cancel.GetTouch()) {
stroke(255);
fill(0);
text("Pressed 'Cancel'", 10, 30);
}
}
Of course, TButton is just a basic library to make it easier to get started with menus. I think the next step is to make it easier to crop and upload images as buttons, much like Alain’s ArdTouch project that mimics an iPhone interface. I’d love to check out other cool Slide menu projects and code too – jhuynh at gmail