arduino + c64 joystick PDF Stampa E-mail
Scritto da Blac]{out   
Sabato 19 Settembre 2009 08:40

 Little Arduino's experiment : I'd linked an old c64 joystick with it. / Un piccolo esperimento con Arduino: ho collegato un vecchio joystick (c64) ad esso.

Wiring / Wiring

FREE photo hosting by photo.promisehosting.net

Proto Coding / Prototipo

FREE photo hosting by photo.promisehosting.net

code:

/**
 * C64 anaJoy - GRAYHATS lab 010 001 111 - blackout AT grayhats.org
 * copyleft 2009 - under GPL3.0
 *
 *
 * c64 pins
 * ----------------------------
 * pin 1-4 = up/down/left/right
 * pin 8 = gnd
 * pin 6 = fire
 * ----------------------------
 *
 */

int anaUpper = 1;
int anaDown  = 2;
int valUpper = 0;
int valDown  = 0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  valUpper = analogRead( anaUpper );
  valDown  = analogRead( anaDown  );
  if( valUpper == 0 ) {
    Serial.println( "Joy Up" );
  }
  if( valDown  == 0 ) {
    Serial.println( "Joy Down" );
  }
  delay(300);
}

Ultimo aggiornamento Sabato 19 Settembre 2009 08:46
 

Aggiungi commento


Codice di sicurezza
Aggiorna