i am facing issue while whenever key pressed whole column is high(turned on led)
KeyInputMemory[column_count] = (uint16_t) HAL_GPIO_ReadPin(rowport, GPIO_PIN_All);
/* If the key at the current column is pressed (considering an active low setup),
store the LED state in the LEDOutputMemory. */
if (KeyInputMemory[column_count] == 0)
{
LedOutputMemory[column_count] = GPIO_PIN_RESET; // Store the LED ON state for the respective column
}
else
{
LedOutputMemory[column_count] = GPIO_PIN_SET; // Store the LED OFF state for the respective column
}
// Now actually write to GPIOA based on LEDOutputMemory
HAL_GPIO_WritePin(GPIOA, (1 << column_count), LedOutputMemory[column_count]);
/* Compare with stored key input */
if (KeyInputMemory[column_count] == StoredKeyInput[column_count])
{
KeyInputCounter[column_count]++;
if (KeyInputCounter[column_count] > 5)
{
StoredKeyInput[column_count] = KeyInputMemory[column_count];
}
}
else
{
StoredKeyInput[column_count] = KeyInputMemory[column_count];
KeyInputCounter[column_count] = 0;
}
Hi in above code, i am reading the key inputs from the port b and stored and compared. i have a physical keyboard each key is soldered correspondind led, whenever the key is pressed particular led should glow, but in my scenario whenever the key is pressed whole column is high means whole column led's turning on.....
