Hello!
Currently, I am trying to save values in an array and use them in one of my functions inside the class Sequencer.
The error message I get is: expression must have pointer-to-object type. Could anyone explain to me what I do wrong?
Arrays inside the header file:
std::array<int, 8> bit1{{0, 1, 0, 1, 0, 1, 0, 1}};
std::array<int,8> bit2{{0, 0, 1, 1, 0, 0, 1, 1}};
std::array<int,8> bit3{{0, 0, 0, 0, 1, 1, 1, 1}};
Function:
void Sequencer::muxUpdate()
{
for (int i{0}; i < 8; ++i)
{
// bit1 = bitRead(i, 0);
// bit2 = bitRead(i, 1);
// bit3 = bitRead(i, 2);
/* bit1 = 1;
bit2 = 1;
bit3 = 0; */
digitalWrite(pin_Out_S0, bit1[2]);
digitalWrite(pin_Out_S1, bit2[2]);
digitalWrite(pin_Out_S2, bit3[2]);
digitalWrite(ledMuxCom, HIGH);
buttonMuxState[i] = digitalRead(buttonMuxCom);
potiMuxState[i] = analogRead(potiMuxCom);
delay(70);
}
}