#include "SpinWearables.h"
using namespace SpinWearables;
void setup() {
// Ensure all of the SpinWheel hardware is on.
SpinWheel.begin();
}
void loop() {
// Read all sensor data.
SpinWheel.readIMU();
// Save the x-axis measurement in a variable.
int x = SpinWheel.ax*255;
// Turn off all LEDs.
SpinWheel.clearAllLEDs();
// If the tilt is in a given direction,
// turn on the corresponding LED.
// We only want the SpinWheel to register
// if the tilt is sufficiently large.
if (x > 10) {
SpinWheel.setLargeLED(5, x, x, x);
}
else if (x < -10) {
SpinWheel.setLargeLED(7,-x,-x,-x);
}
SpinWheel.drawFrame();
}