First Arduino test program

It’s far from exciting, but I wrote my very first test program for the Arduino. Definitely easy! All it does is watch for finger-presses on the OLED, and then writes the location in text to the screen, and also places a pulsing (the central dot changes color rapidly and randomly) target wherever you touch (I haven’t calibrated the screen yet as you may have noticed), only redrawing when it needs to. I still have a lot to figure out, but it works!

Anyway, I’ll write something more substantial later, but this just shows how easy it is to get the Arduino up and running by someone who’s got no recent experience with microcontrollers.

Code for this is really easy:

void setup()
{
;
}
 
int oldmouseX;
int oldmouseY;
int tmouseX;
int tmouseY;
 
int r;
int g;
int b;
 
void loop() 
{
  gettouch();
  tmouseX = mouseX;
  tmouseY = mouseY;
  if (tmouseX != oldmouseX || tmouseY != oldmouseY)
  {
  oldmouseX = mouseX;
  oldmouseY = mouseY;
  background(0);
  fill(255, 0, 0);
  ellipse(mouseX, mouseY, 20,20);
  fill(225);
  ellipse(mouseX, mouseY, 15,15);
  fill(195);
  ellipse(mouseX, mouseY, 10,10);
  fill(165);
  ellipse(mouseX, mouseY, 5,5);
  fill(0);
  text(oldmouseX, 10, 10);
  text(oldmouseY, 10, 30);
  delay(100);
  }
  else
  {
  r = random(128, 255);
  g = random(128, 255);
  b = random(128, 255);
  fill(r, g, b);
  ellipse(mouseX, mouseY, 5,5);
  delay(50);
  }
}

My new toys

Great news at the post office! In the picture are an Arduino Duemilanove microcontroller board, a Basic Stamp based microcontroller board (pin-compatible with the Arduino), a lithium battery pack that can power either of them, and a tiny full color OLED touch screen interface that will attach to either (from Liquidware). I’ve also got my eyes on this TV-out shield for future projects — although I sort of think the YBox2 would be more fun. And while I’m in “I want” mode, I’d also love a Peggy2.

microcontrollers

Astronaut Jones

i-blast-off-in-to-outer-spas

Handyman

I’ve been doing a little bit of work on my submarine (the progress of which you can see at DIYsubmarine.com) — my very small, simple sub, which is nothing compared to more impressive home jobs like Peter Madsen’s KRAKA — but am thinking that this weekend I will take a quick break and build a small boat. I’m thinking of whipping together a Mini Max (that link will give you plans that you can download — this one contains a video) or something similar. I really like the tiny little power boats that can built from plans with a couple sheets of plywood and a weekend’s worth of spare time. The video below is a Mini Most (the plans are on that same site I linked earlier — and here’s another site with free classic boat plans), which is also high on my to-build list, but I really think I’ll quickly knock out the Mini Max because it’s so quick-n-easy… it was advertised as having a build cost of $20 when it was first designed.

It’s really nice having this big space… Other than my back yard at my old house at Queen and Bathurst, I haven’t had a real workspace since I lived on my childhood farm.

Nefarious plays the BEAST

Nefarious and I finished Ozma of Oz and tomorrow will set out upon a new book, assuming she’s not too tired and cranky — the guys in the studio next to us, who are in a not-particularly-exciting hardcore band are jamming extremely loudly, so she gets to stay up a little later than usual. We briefly stopped in so Nefarious could see what was going on and so we could find out how late they’d be playing, and as soon as we got home she dragged out my guitar and started copying their antics.

ari-and-the-beast-1

ari-and-the-beast-2