Thursday, 7 January 2010

Antipasto Arduino 0.8.38 Released with Slide Button Library

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:

The antipasto_arduino repository is located on github.

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.

clip_image002

Here’s the simple ButtonDialog example I’ve included:

SONY DSC

SONY DSC

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

SN3B0101.jpg

DSC05647.JPG

0 comments:

Post a Comment