Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Arduino source code: resistive joystick exercise
// Joystick exercise
#define JOYX A0
#define JOYY A1
#define BUTTON 7
int JoyX,JoyY;
boolean Button;
//-- Helper routine for printf()
int s_putc(char c, FILE *t) {
void setup() {
Serial.begin (9600);
fdevopen(&s_putc,0); // set up serial output for printf()
Serial.println ("Joystick exercise");
Serial.println ("Ed Nisley - KE4ZNU - May 2017");
void loop() {
JoyX = analogRead(JOYX);
JoyY = analogRead(JOYY);
Button = digitalRead(BUTTON);
printf("%05d - %05d - %1d\r",JoyX,JoyY,Button);

ednisley commented May 3, 2017

More details on my blog at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment