Hey guys, I'm programming a Simon Says game on an FPGA.
Problem: I cannot detect if a player is cheating. I've defined 'cheating' as pressing more than 1 button during the player's turn, but whenever I do that, somehow it's being flagged as 'incorrect' and not cheating.
Current output: Pressing more than one button leads to a msg saying the player was 'incorrect'.
Expected output: msg saying the player was 'cheating' and the lights flash 5 times.
There's something wrong with my logic but I don't know what. The board is working fine and it's debounced. Any advice appreciated. Thank you
void cheating_state(int btnValue) {
xil_printf("Entered CHEATING state. \n\r");
// Flash all LEDs 5 times at 2 Hz (flashes on for 0.5 seconds, off for 0.5 seconds)
flash_leds(5, 2); // 3 flashes at 1Hz
// Transition to the GAME_OVER state after flashing the LEDs
current_state = GAME_OVER;
}```