Go Down

Topic: Arduino Nes controller, Please Help! (Read 7 times) previous topic - next topic

Nick Gammon

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Threads merged.

- Moderator

Craftee


Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Threads merged.

- Moderator



D: sorry, i wasnt getting any responses so i expanded my search :( forgive me


also, how do i fix the "BYTE" problem?(i have no clue as to what im doing)

Craftee


Are you trying to compile the Processing sketch in the Arduino IDE? That's exactly the error I get when I try that.

A visit to http://processing.org is in your future.


I downloaded it and rand the thing through processing, but now i get
Code: [Select]
cannot find anything named "KeyEvent.VK_L"

Craftee

so i have this old peice of code here, and i get an error saying "The 'BYTE' keyword is no longer supported" so what do i use instead? please help!

Code: [Select]
const int latch = 2;
const int clock = 3;
const int data  = 4;

#define latchlow digitalWrite(latch, LOW)
#define latchhigh digitalWrite(latch, HIGH)
#define clocklow digitalWrite(clock, LOW)
#define clockhigh digitalWrite(clock, HIGH)
#define dataread digitalRead(data)
#define wait delayMicroseconds(200)

byte output;

void setup() {
Serial.begin(9600);
pinMode(latch, OUTPUT);
       pinMode(clock, OUTPUT);
       pinMode(data, INPUT);
}

void loop() {
 output = 0;
 ReadNESjoy();
 Serial.print(output, BYTE);
}


void ReadNESjoy() {
 latchlow;
 clocklow;
 latchhigh;
 wait;
 latchlow;
 for (int i = 0; i < 8; i++) {
    clockhigh;
    wait;
    output += dataread * (1 << i);
    clocklow;
    wait;
 }
}

AWOL

Topics merged.
Please don't start a new thread on the same subject.

Look up "Serial.write".
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up