 // A sampling cycle may take at most this long.
 // If the sample runs over, an error message will be generated
 #define CYCLE_MILLIS_MAX  5000
+
+////////////////////////////////////////
+
+#include <AnalogSampler.h>
+
+AnalogSampler audioSampler(AUDIO_PIN);
+AnalogSampler vibroSampler(VIBRO_PIN);
+AnalogSampler photoSampler(PHOTO_PIN);
 
 ////////////////////////////////////////
 


////////////////////////////////////////

#define PHOTO_PIN A2

////////////////////////////////////////

#include "eh-timer.h"

////////////////////////////////////////


void setup() {
    Serial.begin(9600);
    bmp085.setup();
    
    //lastCycle_highBits = 0;
    //lastCycle_lowBits = millis();

#include <Wire.h>

////////////////////////////////////////

#define AUDIO_PIN A0
#define VIBRO_PIN A1
#define PHOTO_PIN A2
// A4 is reserved for I2C
// A5 is reserved for I2C

////////////////////////////////////////

#define AUDIO_OSC_PREFIX         "/eddie/head/sensor/phone"
#define BMP085_OSC_PREFIX        "/eddie/head/sensor/BMP085"
#define DHT22_OSC_PREFIX         "/eddie/head/sensor/dht22"
#define PHOTO_OSC_PREFIX         "/eddie/head/sensor/photo"
#define TIMER_OSC_PREFIX         "/eddie/head/timer"
#define VIBRO_OSC_PREFIX         "/eddie/head/sensor/piezo"

// Each sampling cycle must take at least this long.
// If a cycle is finished sooner, we will wait before starting the next cycle.
