Thursday, January 7, 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

6 comments:

Matt said...

whoa i love those icons...

ndudman said...

Great...

I have written quite a bit or code, first in processing, still waiting for my slide to be delivered. Its ported overto the Arduino enviroment, but not tested yet although it worked well inside processing.

Basicly its a kind of menu/tool bar system menu disapears after 5 seconds of non use and gives its space up to the current selected screen. I've made a spread sheet widget which can display data in simple xls spreadsheet style(scroll bars clicking on cells etc). A keyboard based upon a phone that you can hit keys a few times and they alternate between numbers and text etc. Also a charting app for drawing line (etc) charts... it shars data with the table so you can switch between the two and see how things change. If anyone is interested to see the code already they are welcome... I've not yet tried it on the sheild but it compiles and did work nicly under processing. Anyone want a try it in processing I can share the sketch.

Neil

Matt said...

@ndudman ... um, i'd definitely like to try it out on my slide too... inthebitz at gmail. how'd you do the line charting?

Alan said...

Hi Justin! Thanks for the article !
I just precise that all the code (for arduino, TouchShield, and Windows) is here http://kalshagar.wikispaces.com/ardTouch (same site).

I'll resume working on the ardTouch when I have finished a current project and post you with latest updates. Cheeers!

ndudman said...

I'm having problems uploading code to Mega using the new Lunux build mentioned in this blog. I get
[exec] avrdude: stk500_recv(): programmer is not responding
[exec] avrdude: stk500_2_ReceiveMessage(): timeout
[exec] avrdude: stk500_2_ReceiveMessage(): timeout
... Using normal Arduino 017 I can upload ok to Mega. I've tried with the slide connected and disconnected, both the same. The board.txt is the same for working 17 and the latest Antipasto... any ideas on what to try ?

ndudman said...

@Matt

Heres a video of it working on processing... I'm afraid I havn't got it working yet with TouchSlide... but can email you the processing stuff to look at.

http://www.youtube.com/watch?v=9CW3-wFHapQ