Digital Dowsing report 3

Old PS2 trackball mouse, snootlab SD shield on a borrowed Arduino Uno (SMD Edition)

Old PS2 trackball mouse, snootlab SD shield on a borrowed Arduino Uno (SMD Edition)


The Digital Dowser took another step forward last night. Backstory here and then here. It seems that my Snootlab Memoire shield was somehow not friends with the old Arduino Diecimila I borrowed from Martin, so relying once more on the kindness of strangers it seems my duty to do as a wannabe hacker, I got in touch with Bruno Sinou, recently moved to Berlin from Paris who mentioned he had a few knocking about when we met each other at Martin’s last earthcode Berlin performance.

And so with a more modern Arduino on hand, I found that the shield performed as it should do with no hiccups or having to delve into alternative SDfat libraries (which are actually quite interesting, however, having many more examples than the SD library bundled with the current Arduino IDE).

What I’ve hacked together is the PS2 Mouse library and the AnalogLogger Example from the SdFat library. The wires from the PS/2 Mouse are connected to the Arduino pins thus:

Orange: 5V
Red: Gnd
Yellow (Clock): Digital 6
Black (Data): Digital 5

NB: The Snootlab Memoire shield has a handy LED-resistor combo hanging on digital pin 9 which I set to flash when data is being written to the card.

Here, for the curious, is the Arduino sketch (this will change when I get my head around this Arduino/C++ stuff)

// A hack of the following scripts:
// ps2_mouse in the examples folder of the ps2 library (https://www.arduino.cc/playground/ComponentLib/Ps2mouse)
// AnalogLogger in the SdFat library (https://code.google.com/p/beta-lib/downloads/detail?name=SdFatBeta20120825.zip&can=2&q=)
// The AnalogLogger uses RTClib from https://github.com/adafruit/RTClib
// Daniel Belasco Rogers Oct 2012

#include 
#include   // define FreeRam()
#include 
#include 
#include 

#define CHIP_SELECT     SS  // SD chip select pin
#define LOG_INTERVAL  1000  // mills between entries
#define ECHO_TO_SERIAL   1  // echo data to serial port if nonzero
#define WAIT_TO_START    1  // Wait for serial input in setup()

// file system object
SdFat sd;

// text file for logging
ofstream logfile;

// Serial print stream
ArduinoOutStream cout(Serial);

// buffer to format data - makes it eaiser to echo to Serial
char buf[80];

// define the Real Time Clock object
RTC_DS1307 RTC;  

// initialise the ps2 mouse
PS2Mouse mouse(6, 5);

int posx;   // a variable to hold cumulative position for x
int posy;   // a variable to hold cumulative position for y


// store error strings in flash to save RAM
#define error(s) sd.errorHalt_P(PSTR(s))

// call back for file timestamps
void dateTime(uint16_t* date, uint16_t* time) {
    DateTime now = RTC.now();

  // return date using FAT_DATE macro to format fields
  *date = FAT_DATE(now.year(), now.month(), now.day());

  // return time using FAT_TIME macro to format fields
  *time = FAT_TIME(now.hour(), now.minute(), now.second());
}
//------------------------------------------------------------------------------
// format date/time
ostream& operator < < (ostream& os, DateTime& dt) {
  os << dt.year() << '/' << int(dt.month()) << '/' << int(dt.day()) << ',';
  os << int(dt.hour()) << ':' << setfill('0') << setw(2) << int(dt.minute());
  os << ':' << setw(2) << int(dt.second()) << setfill(' ');
  return os;
}
//------------------------------------------------------------------------------
void setup() {
  Serial.begin(9600);

  // set up LED on logging shield
  pinMode(9, OUTPUT);
  
  // start mouse
  mouse.init();

  // pstr stores strings in flash to save RAM
  cout << endl << pstr("FreeRam: ") << FreeRam() << endl;

#if WAIT_TO_START
  cout << pstr("Type any character to start\n");
  while (Serial.read() < 0) {}
#endif  // WAIT_TO_START

  // connect to RTC21
  Wire.begin();
  if (!RTC.begin()) error("RTC failed");

  // set date time callback function
  SdFile::dateTimeCallback(dateTime);
  DateTime now = RTC.now();
  cout  << now << endl;


  // initialize the SD card at SPI_HALF_SPEED to avoid bus errors with
  if (!sd.begin(CHIP_SELECT, SPI_HALF_SPEED)) sd.initErrorHalt();

  // create a new file in root, the current working directory
  char name[] = "LOGGER00.CSV";

  for (uint8_t i = 0; i < 100; i++) {
    name[6] = i/10 + '0';
    name[7] = i%10 + '0';
    if (sd.exists(name)) continue;
    logfile.open(name);
    break;
  }
  if (!logfile.is_open()) error("file.open");

  cout << pstr("Logging to: ") << name << endl;

  // format header in buffer
  obufstream bout(buf, sizeof(buf));

  bout << pstr("millis");

  bout << pstr(",date,time");

  bout << pstr(",mousex,mousey");

  logfile << buf << endl;

#if ECHO_TO_SERIAL
  cout << buf << endl;
#endif  // ECHO_TO_SERIAL
}
//------------------------------------------------------------------------------
void loop() {
  uint32_t m;

  // wait for time to be a multiple of interval
  do {
    m = millis();
  } while (m % LOG_INTERVAL);

  // use buffer stream to format line
  obufstream bout(buf, sizeof(buf));

  // start with time in millis
  bout << m;

  DateTime now = RTC.now();
  bout << ',' << now;

  // get mouse data
  MouseInfo mouseInfo;
  mouse.getData(&mouseInfo);

  // increment positions from x y
  posx += int(mouseInfo.x);
  posy += int(mouseInfo.y);

  // push positions to buffer
  bout << ',' << posx;
  bout << ',' << posy;
  bout << endl;

  // log data and flush to SD - flash led
  digitalWrite(9, HIGH);
  logfile << buf << flush;
  digitalWrite(9, LOW);

  // check for error
  if (!logfile) error("write data failed");

#if ECHO_TO_SERIAL
  cout << buf;
#endif  // ECHO_TO_SERIAL

  // reset position if left mouse button clicked
  if (mouseInfo.leftClick){
  posx = posy = 0;
  }

  // don't log two points in the same millis
  if (m == millis()) delay(1);
}

Now 'all' I have to do is design and build a way of attaching the black plastic encoder wheels to the dowsing rods - reliably, mind. No pressure.

Posted in Diary, Linux, Walking | Tagged , , | 1 Comment

Text Message Cross Stitch Sampler

As the temperature has dropped somewhat here in Berlin, the nights draw in and there is a smack of Autumn in the air, I thought I’d get some fireside activities under way:

Text Message Cross Stitch Sampler

Text message cross stitch sampler start

Inspiration has been the record of all text messages that Soph and I have kept since about 2005 or so which are currently in the GPS database but not yet geolocated (perhaps this is another fireside activity). I can’t actually claim this as my idea: Soph has already produced some samplers using this technique, researching the old Nokia phone font (which you can download for free here), you can see an example of her work on our text message page.
I know, I should be using KxStitch to plan my sampler but for some reason I can’t compile it on my updated Ubuntu 12.04 (Precise Pangolin) – it coughs at Imagemagick even though I’ve got it installed and I can’t be bothered to find a workaround. Maybe I should write to the author…

Posted in Diary | Tagged , , | Comments Off on Text Message Cross Stitch Sampler

Sideways Festival and Walking Artists Network

Thursday 13 September – travelling

Ruby on replacement bus

Ruby on replacement bus going to the Sideways Festival in Zutendaal


We had a bit of a difficult journey to Zutendaal involving a bus replacement service between Aachen and Verviers but we finally made it to Maastricht and then took a taxi to where we were staying, which was a sort of Belgian Truman Show set
Narvic HomeParc Zutendaal

Narvic HomeParc Zutendaal – Truman Show set Belgian style


but very comfortable to stay in for the people of the Sideways Festival and the Walking Artists Network, who had generously offered me a bursary to be there and to bring Ruby.
Friday 14 September
Ruby and Dan collaborative drawing 13 - 14 Sept 2012

Ruby and Dan collaborative drawing 13 – 14 Sept 2012


We, the Walking Artists Network [WAN], chaired by the fantastic Clare Qualman (who’d been so patient and lovely in the lead up and was wonderfully friendly and welcoming on arrival) and Mark Hunter, introduced ourselves and then began to make suggestions for what to do in the afternoon, posted them on post-its and got doing stuff. I proposed a dowsing session, not really wanting to dictate how people should do it. It was fun, but left me with a sense that I should inform myself about the techniques as people seem to want some guidance on it. I was reluctant to impose my self-developed ‘technique’ on everyone but perhaps it would have been more honest to, in some ways. In any case, it was fascinating to me how many of the WAN wanted to try it out, including some hard skeptics, open minded enough to give it a go.
Dowsing with the WAN

Dowsing with the WAN


Saturday 15 September
Ruby and Dan Collaborative Drawing 15 Sept 2012 During Sideways Conference

Ruby and Dan Collaborative Drawing 15 Sept 2012 During Sideways Conference, De Lieterberg


As promised in this earlier post, I’d taken some large sheets of good-quality paper with me with the intention of collaborating with Ruby on drawing and perhaps documenting walking with them. After the first, rather tentative attempt, I felt that we really got into our swing listening to the speakers of the conference, including Sacha Kagan, Jan Masscheleien and the very inspiring Tim Ingold, who’s writings have had a large impact on our thinking about our work.
Later, there was a chance to catch up with what some of the artists of the Sideways Festival had been doing outside in marquees dotted around the park, a ‘Barefoot Trail’ that Ruby enjoyed until she fell in a particularly muddy part and a fantastic promenade performance sound-walk by Orquestina de Pigmeos.
This was the drawing we made on the journey back
Ruby Dan Collaborative Drawing 16 Sept 2012

Ruby Dan collaborative drawing 16 Sept 2012 returning from Zutendaal to Berlin by train


It was a wonderful weekend of meeting fantastic people and I left feeling utterly inspired and revived.

Posted in Diary, Walking | Tagged , , , , , | 2 Comments

Ruby’s Writing

Ruby Inscription

Ruby’s writing 2012, Pencil on paper, red wool


Ruby loves writing at the moment and her handwriting is changing all the time. This weekend she was wanting to know how to do everything joined up but last week, her style (above) reminded me of early Roman inscriptions, especially on the fringes of the Empire, perhaps at the tail end (early Christian inscriptions in the UK) which were also a major influence on David Jones, one of my all-time favourite artists and much underrated.
David Jones Cara Wallia Derelicta 1950

David Jones Cara Wallia Derelicta 1950 Opaque watercolour on an under-painting of Chinese white

Posted in Diary | Tagged , , , | Comments Off on Ruby’s Writing

Off to the Sideways Festival

Something that’s been in my mind since my ‘Going Solo’ residency is how to (re)present walks, and if one should. Sometimes I think the best artistic practice around walking is simply taking people on a walk. I know Heimo Lattner and Martin Nachbar might agree… Still, as a mark maker at heart, even if I’m mostly doing that digitally these days, it still niggles at me.

Packing paper in the suitcase for the Sideways Festival in Zutendaal

Packing paper in the suitcase for the Sideways Festival in Zutendaal

And so it is that I’m packing some large, folded sheets of Accademia paper for my trip with Ruby to the last of the Sideways Festival in Zutendaal, Belgium this weekend. I’m interested in the marks they are going to accrue as we transport them about and its already started with the scars the paper bears from its initial trip from our studio to home.

It’s also the last week of Verortete Verlangen, the group show we’re in at the Alte Feuerwache, Friedrichshain and so Pia Linz and Zuzanna Skiba’s work is in my mind.

Posted in Diary, Walking | Tagged , , , | Comments Off on Off to the Sideways Festival