Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 15, 2020 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/541c6c5d33b0e10e19532876502db71f to your computer and use it in GitHub Desktop.
Save parzibyte/541c6c5d33b0e10e19532876502db71f to your computer and use it in GitHub Desktop.
/*
Programado por Luis Cabrera Benito
____ _____ _ _ _
| _ \ | __ \ (_) | | |
| |_) |_ _ | |__) |_ _ _ __ _____| |__ _ _| |_ ___
| _ <| | | | | ___/ _` | '__|_ / | '_ \| | | | __/ _ \
| |_) | |_| | | | | (_| | | / /| | |_) | |_| | || __/
|____/ \__, | |_| \__,_|_| /___|_|_.__/ \__, |\__\___|
__/ | __/ |
|___/ |___/
Blog: https://parzibyte.me/blog
Ayuda: https://parzibyte.me/blog/contrataciones-ayuda/
Contacto: https://parzibyte.me/blog/contacto/
*/
#define EJE_X 0
#define EJE_Y 1
#define BOTON 2
void setup() {
Serial.begin(9600);
// Será de tipo entrada
pinMode(BOTON, INPUT_PULLUP);
}
void loop() {
int valorX = analogRead(EJE_X),
valorY = analogRead(EJE_Y),
botonPulsado = digitalRead(BOTON);
Serial.print("\nValor X: ");
Serial.print(valorX);
Serial.print("\nValor Y: ");
Serial.print(valorY);
Serial.print("\nBotón pulsado: ");
Serial.print(botonPulsado);
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment