I translated a C-Control listing (working) into an Arduino program (only for studyng purposes to learn the Arduino), but get some errors. What do I wrong?
See enclosed program
I2C_Chipcard.ino (3.03 KB)
I translated a C-Control listing (working) into an Arduino program (only for studyng purposes to learn the Arduino), but get some errors. What do I wrong?
See enclosed program
I2C_Chipcard.ino (3.03 KB)
but get some errors. What do I wrong?
For one thing, you didn't post the errors.
Without knowing what the problems are, we can't say what else you did wrong.
Errors:
I2C_Chipcard.ino: In function 'void setup()':
I2C_Chipcard.ino:52:77: error: invalid use of void expression
I2C_Chipcard.ino: In function 'void Read_Chipcard(int)':
I2C_Chipcard.ino:88:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
Error compiling.
Serial.print(intN); Serial.print("\t"); Serial.print(Read_Chipcard(intN)); Serial.print("\n");
I HATE when people put multiple statements on one line. The compiler can't tell you which statement is causing the problem. It can only tell you that it happens somewhere on this line.
But, it doesn't take a rocket scientist to figure out that Read_Chipcard() does not return anything, so it makes no sense trying to print what it returned.
Of course, having a return statement in a function that doesn't return a value is not a mark of a rocket scientist, either.