Last active
August 10, 2016 03:10
-
-
Save paultnylund/b0a60dfae7f13dd0aa11f701d9d7d46d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <Adafruit_Sensor.h> | |
#include <Adafruit_BNO055.h> | |
#include <utility/imumaths.h> | |
#include <Functions_SPROID.h> | |
void setup() { | |
init(); | |
} | |
void loop() { | |
if( !isIncreasing(rotationAboutY()) ) { | |
if( isIncreasing(myoAnalogRead()) ) { | |
digitalWrite(LED_PIN, HIGH); | |
digitalWrite(VIB_PIN, HIGH); | |
} else if( isDecreasing(myoAnalogRead()) ) { | |
Serial.println("You are not doing anything"); | |
} | |
} | |
if( isIncreasing(rotationAboutY()) ) { | |
if( isIncreasing(myoAnalogRead()) ) { | |
Serial.println("You are tightening"); | |
} else if( isDecreasing(myoAnalogRead()) ) { | |
Serial.println("This should not happen"); | |
} | |
} | |
if( isDecreasing(rotationAboutY()) ) { | |
if( isIncreasing(myoAnalogRead()) ) { | |
Serial.println("You are untightening"); | |
} else if( isDecreasing(myoAnalogRead()) ) { | |
Serial.println("This should not happen"); | |
} | |
} | |
if( !isDecreasing(rotationAboutY()) ) { | |
if( isIncreasing(myoAnalogRead()) ) { | |
Serial.println("You are only tightening your muscle"); | |
} else if( isDecreasing(myoAnalogRead()) ) { | |
Serial.println("You are not doing anything"); | |
} | |
} | |
/* Wait the specified delay before requesting next data */ | |
// delay(BNO055_SAMPLERATE_DELAY_MS); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment