expected ' ; ' before ' ) ' token

Arduino: 1.8.13 (Windows Store 1.8.39.0) (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\Documents\Arduino\sketch_jun17a\sketch_jun17a.ino: In function 'void onClock()':

sketch_jun17a:40:35: error: expected ')' before 'address'

sprintf(output, " %04x %c %02x" address, digitalRead(READ_WRITE) ? 'r' : 'W', data);

^~~~~~~

exit status 1

expected ')' before 'address'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

^

exit status 1

expected ';' before ')' token

This code is copied excactly as writen by Ben Eater on youtube in his 6502 part 1 video, and of course it complied for him

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

sprintf(output, " %04x %c %02x" );address, Right there.

This line of code does not make sense. Can you post your complete sketch using code tags?

   sprintf(output, " %04x %c %02x" );address, digitalRead(READ_WRITE) ? 'r' : 'W', data);

^
should it have been?

   sprintf(output, " %04x %c %02x", address, digitalRead(READ_WRITE) ? 'r' : 'W', data);

ok, i edited question and applied your suggestion and I believe it improved but stiil

expected ' ) ' before "address"

try

   sprintf(output, " %04x %c %02x", address, (digitalRead(READ_WRITE) ? 'r' : 'W'), data );

I copied your code and pasted over mine and it compiled.....thanks

sprintf(output, " %04x %c %02x", address, (digitalRead(READ_WRITE) ? 'r' : 'W'), data );

You're welcome. Although it can compile and be wrong... I think it should be okay though...

yes thanks again,

alot more work ahead but I was stuck and I hope to go over the differences and learn. :slight_smile:

Not like Ben.

Actually it didn’t compile for him....
See 17:30 in the video.

He explains why “looks like I missed a comma here” and corrects it :wink:

oh, I did catch that, thanks for taking the time though i'll post if it works

successful compile and arduino reading 6502 chip but i'm not getting it reading same as Ben