Hi guys.
I am totally new to Arduino, but have so much fun with it (to a point:)).
For now, I am trying to build a controller that will convert my old church analog organ into MIDI console.
Using some examples, and common logic, i got something like below. However ... ther must be mistake somewhere, since my Serial console outputs:
14:19:00.944 -> 128 - 41 pressed
14:19:00.944 -> 128 - 91 pressed
14:19:00.944 -> 128 - 97 pressed
14:19:00.944 -> 128 - 41 pressed
14:19:00.978 -> 128 - 91 pressed
14:19:00.978 -> 128 - 97 pressed
14:19:00.978 -> 128 - 41 pressed
14:19:00.978 -> 128 - 91 pressed
14:19:00.978 -> 128 - 97 pressed
14:19:00.978 -> 128 - 41 pressed
14:19:00.978 -> 128 - 91 pressed
14:19:00.978 -> 128 - 97 pressed
14:19:00.978 -> 128 - 41 pressed
I am surprised to see that, as it appears to happen only for couple PIN's. Moreover, there are no electronic connections made yet, so empty, unwired pins. Another mistery ... 128 message should be sent when key was released, but there's no 144 message stating it was ever pressed ...
Since I am new and not allowed to upload attachments - code here: Nov 22 7:00 AM - Codeshare
Surprising bit is that, if i modify my function so it looks:
void checkColumnsForRow(int row) {
manual1[row][0] = digitalRead(A8);
manual1[row][1] = digitalRead(A9);
manual1[row][2] = digitalRead(A10);
manual1[row][3] = digitalRead(A11);
manual1[row][4] = digitalRead(A12);
manual1[row][5] = digitalRead(A13);
manual1[row][6] = digitalRead(A14);
manual1[row][7] = digitalRead(A15);
Serial.print(row); Serial.print(": ");
Serial.print(manual1[row][0]); Serial.print(", ");
Serial.print(manual1[row][1]); Serial.print(", ");
Serial.print(manual1[row][2]); Serial.print(", ");
Serial.print(manual1[row][3]); Serial.print(", ");
Serial.print(manual1[row][4]); Serial.print(", ");
Serial.print(manual1[row][5]); Serial.print(", ");
Serial.print(manual1[row][6]); Serial.print(", ");
Serial.print(manual1[row][7]); Serial.print(", ");
Serial.println("");
}
It can output this way:
0: 1, 1, 1, 1, 1, 1, 1, 1,
1: 1, 1, 1, 1, 1, 1, 1, 1,
2: 1, 1, 1, 1, 1, 1, 1, 1,
3: 1, 1, 1, 1, 1, 1, 1, 1,
4: 1, 1, 1, 1, 1, 1, 1, 1,
5: 1, 1, 1, 1, 1, 1, 1, 1,
6: 1, 1, 1, 1, 1, 1, 1, 3,
7: 2, 1, 1, 1, 7, 3, 1, 1,
How is this possible, i thought digitalRead can be either 0 or 1, not 2 or 7 or 3 ...
Shortened version... Nov 14 9:42 PM - Codeshare