AccelerationReading accel = {0, 0, 0};
void setup() {
Serial.begin(57600);
}
void loop() {
accel = Bean.getAcceleration();
uint16_t xAcceleration = (abs(accel.xAxis)) / 4;
if(xAcceleration > 2) {
Bean.setLed((uint8_t) xAcceleration,0,0);
Bean.sleep(500);
}
Bean.setLed(0,0,0);
}