Hello,
I am very new to the Arduino. Just wondering:
right now I want to collaborate processing and Arduino
for these:
I wanna do something like:
if I push two buttons at same time, the arduino will store these on-switch pin numbers and return the number of activate pins ( in this case, 2)
right now i have code:
like:
int player1Pins = 2;
int player1Pin [] = {3,2};
for(int i = 0; i< player1Pins; i++){
buttonState = digitalRead(player1Pin*);*
-
if(buttonState != lastButtonState){*
-
if(buttonState == HIGH ){*
_ Serial.println(player1Pin*);*_
* buttonPushTimes++;*
* }*
* delay(50);*
* lastButtonState = buttonState; *
}
However, the serial wont print out anything if I pushed both switch together.
Any help? Thank you guys!