Sure here it is I'm currently only doing the X value because more values done wrong would just mean more things to correct.adafruit_support_bill wrote:Can you post the code you are using now?
Code: Select all
#define SerialPin 0 // Serial debug via Bluefruit EZ-Link on this pin
#define A1 2
#define A2 4
#define A3 3
#include <SoftwareSerial.h> // Software serial library (standard in Arduino 1.x +)
SoftwareSerial BT = SoftwareSerial(2, 0);
SoftwareSerial Serial(2,0); // Serial transmission on Trinket Pin 0, receive pin 2 (not used)
int newX;
int oldX;
void setup() {
Serial.begin(9600); // Send status information via serial
}
void loop()
{
int newX = analogRead(A1);
delay(100); // delay in between reads for stability
if (newX > oldX)
{
//Serial.print ("increase");// If the values increased print increase
Serial.write(11);
}
else if (newX < oldX)
{
Serial.write(7);
//Serial.print ("decrease"); // If it decreases print decrease
}
oldX = newX;
}