Skip to content

Instantly share code, notes, and snippets.

@annem
Created February 15, 2013 21:14
Show Gist options
  • Save annem/4963596 to your computer and use it in GitHub Desktop.
Save annem/4963596 to your computer and use it in GitHub Desktop.
#include <Esplora.h>
#include <ScratchSensors.h>
ScratchSensors Scratchboard;
void setup() {
Scratchboard.init();
}
void loop() {
Scratchboard.Values[SLIDER] = Esplora.readSlider();
Scratchboard.Values[LIGHT] = Esplora.readLightSensor();
Scratchboard.Values[SOUND] = Esplora.readMicrophone();
Scratchboard.Values[BUTTON] = map(Esplora.readButton(SWITCH_4), 0, 1, 0, 1023);
Scratchboard.Values[RESISTA] = map(Esplora.readAccelerometer(X_AXIS), -512, 512, 0, 1023);
Scratchboard.Values[RESISTB] = map(Esplora.readAccelerometer(Y_AXIS), -512, 512, 0, 1023);
Scratchboard.Values[RESISTC] = map(Esplora.readJoystickX(), -512, 512, 0, 1023);
Scratchboard.Values[RESISTD] = map(Esplora.readJoystickY(), -512, 512, 0, 1023);
Scratchboard.report();
delay(10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment