Skip to content

Instantly share code, notes, and snippets.

@v-ivanyshyn
Last active January 4, 2020 13:49
Show Gist options
  • Save v-ivanyshyn/fe831e6d01235474547cd8cd27404536 to your computer and use it in GitHub Desktop.
Save v-ivanyshyn/fe831e6d01235474547cd8cd27404536 to your computer and use it in GitHub Desktop.
void loop()
{
int x = analogRead(X_PIN);
int y = analogRead(Y_PIN);
if (х < 20 && y < 20)
digitalWrite(pin9, LOW);
else
digitalWrite(pin9, HIGH);
if (х > 1000 && y > 1000)
digitalWrite(pin10, LOW);
else
digitalWrite(pin10, HIGH);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment