Hello I'm new the arduino/teensie world but not to making some effects for music. So I'm new to coding as well.I purchased a teensie 4.1 because I wanted to try
my hand at making a midi peddle. Found some projects on line and successfully breadboarded 2 projects. I came across a project that I want to build and that one gives me errors. I've watched vids on coding and understand a little but not enough. So if there is anyone that might help that would be great.This is the error I keep getting. I also attached the file. It's actually line 59 to 61 that's highlighted
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino: In function 'void updateMuxButtons()':
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:207:17: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
207 | MUXBUTTONS->muxUpdate();
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:208:32: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
208 | byte message = MUXBUTTONS->getValue();
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:212:27: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
212 | switch (MUXBUTTONS->Bcommand) {
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:226:25: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
226 | MUXBUTTONS->Btoggle = 0;
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:222:25: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
222 | MUXBUTTONS->Btoggle = 1;
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:233:27: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
233 | switch (MUXBUTTONS->Bcommand) {
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino: In function 'void updateMuxPots()':
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:254:14: warning: array subscript i is outside array bounds of 'Pot* [0]' [-Warray-bounds]
254 | MUXPOTS->muxUpdate();
| ~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:131:6: note: while referencing 'MUXPOTS'
131 | Pot *MUXPOTS[] {};
| ^~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:255:32: warning: array subscript i is outside array bounds of 'Pot* [0]' [-Warray-bounds]
255 | byte potmessage = MUXPOTS->getValue();
| ~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:131:6: note: while referencing 'MUXPOTS'
131 | Pot *MUXPOTS[] {};
| ^~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:256:60: warning: array subscript i is outside array bounds of 'Pot* [0]' [-Warray-bounds]
256 | if (potmessage != 255) MIDI.sendControlChange(MUXPOTS->Pcontrol, potmessage, MUXPOTS->Pchannel);
| ~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:131:6: note: while referencing 'MUXPOTS'
131 | Pot *MUXPOTS[] {};
| ^~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp: In member function 'void Button::muxUpdate()':
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:59:38: error: no match for 'operator&' (operand types are 'PORTDemulation' and 'int')
59 | if (_numMuxPins > 8) PORTD = PORTD & B11000011;
| ~~~~~ ^
| |
| PORTDemulation
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:60:22: error: no match for 'operator&' (operand types are 'PORTDemulation' and 'int')
60 | else PORTD = PORTD & B11100011;
| ~~~~~ ^
| |
| PORTDemulation
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:61:17: error: no match for 'operator|' (operand types are 'PORTDemulation' and 'byte' {aka 'unsigned char'})
61 | PORTD = PORTD | temp;
| ~~~~~ ^ ~~~~
| | |
| | byte {aka unsigned char}
| PORTDemulation
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp: In member function 'byte Button::getValue()':
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:80:24: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
80 | if (millis() - _time < _debounce) return 255;
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp: In member function 'void Pot::muxUpdate()':
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:124:38: error: no match for 'operator&' (operand types are 'PORTDemulation' and 'int')
124 | if (_numMuxPins > 8) PORTD = PORTD & B11000011;
| ~~~~~ ^
| |
| PORTDemulation
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:125:22: error: no match for 'operator&' (operand types are 'PORTDemulation' and 'int')
125 | else PORTD = PORTD & B11100011;
| ~~~~~ ^
| |
| PORTDemulation
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:127:17: error: no match for 'operator|' (operand types are 'PORTDemulation' and 'byte' {aka 'unsigned char'})
127 | PORTD = PORTD | temp;
| ~~~~~ ^ ~~~~
| | |
| | byte {aka unsigned char}
| PORTDemulation
exit status 1
Compilation error: no match for 'operator&' (operand types are 'PORTDemulation' and 'int')
my hand at making a midi peddle. Found some projects on line and successfully breadboarded 2 projects. I came across a project that I want to build and that one gives me errors. I've watched vids on coding and understand a little but not enough. So if there is anyone that might help that would be great.This is the error I keep getting. I also attached the file. It's actually line 59 to 61 that's highlighted
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino: In function 'void updateMuxButtons()':
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:207:17: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
207 | MUXBUTTONS->muxUpdate();
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:208:32: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
208 | byte message = MUXBUTTONS->getValue();
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:212:27: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
212 | switch (MUXBUTTONS->Bcommand) {
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:226:25: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
226 | MUXBUTTONS->Btoggle = 0;
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:222:25: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
222 | MUXBUTTONS->Btoggle = 1;
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:233:27: warning: array subscript i is outside array bounds of 'Button* [0]' [-Warray-bounds]
233 | switch (MUXBUTTONS->Bcommand) {
| ~~~~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:104:9: note: while referencing 'MUXBUTTONS'
104 | Button *MUXBUTTONS[] {};
| ^~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino: In function 'void updateMuxPots()':
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:254:14: warning: array subscript i is outside array bounds of 'Pot* [0]' [-Warray-bounds]
254 | MUXPOTS->muxUpdate();
| ~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:131:6: note: while referencing 'MUXPOTS'
131 | Pot *MUXPOTS[] {};
| ^~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:255:32: warning: array subscript i is outside array bounds of 'Pot* [0]' [-Warray-bounds]
255 | byte potmessage = MUXPOTS->getValue();
| ~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:131:6: note: while referencing 'MUXPOTS'
131 | Pot *MUXPOTS[] {};
| ^~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:256:60: warning: array subscript i is outside array bounds of 'Pot* [0]' [-Warray-bounds]
256 | if (potmessage != 255) MIDI.sendControlChange(MUXPOTS->Pcontrol, potmessage, MUXPOTS->Pchannel);
| ~~~~~~~~~^
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\MIDI_Crab_v2.ino:131:6: note: while referencing 'MUXPOTS'
131 | Pot *MUXPOTS[] {};
| ^~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp: In member function 'void Button::muxUpdate()':
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:59:38: error: no match for 'operator&' (operand types are 'PORTDemulation' and 'int')
59 | if (_numMuxPins > 8) PORTD = PORTD & B11000011;
| ~~~~~ ^
| |
| PORTDemulation
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:60:22: error: no match for 'operator&' (operand types are 'PORTDemulation' and 'int')
60 | else PORTD = PORTD & B11100011;
| ~~~~~ ^
| |
| PORTDemulation
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:61:17: error: no match for 'operator|' (operand types are 'PORTDemulation' and 'byte' {aka 'unsigned char'})
61 | PORTD = PORTD | temp;
| ~~~~~ ^ ~~~~
| | |
| | byte {aka unsigned char}
| PORTDemulation
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp: In member function 'byte Button::getValue()':
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:80:24: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
80 | if (millis() - _time < _debounce) return 255;
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp: In member function 'void Pot::muxUpdate()':
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:124:38: error: no match for 'operator&' (operand types are 'PORTDemulation' and 'int')
124 | if (_numMuxPins > 8) PORTD = PORTD & B11000011;
| ~~~~~ ^
| |
| PORTDemulation
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:125:22: error: no match for 'operator&' (operand types are 'PORTDemulation' and 'int')
125 | else PORTD = PORTD & B11100011;
| ~~~~~ ^
| |
| PORTDemulation
C:\Users\Guy\Documents\Teensy\MIDI_Crab_v2\Controller.cpp:127:17: error: no match for 'operator|' (operand types are 'PORTDemulation' and 'byte' {aka 'unsigned char'})
127 | PORTD = PORTD | temp;
| ~~~~~ ^ ~~~~
| | |
| | byte {aka unsigned char}
| PORTDemulation
exit status 1
Compilation error: no match for 'operator&' (operand types are 'PORTDemulation' and 'int')