2023-10-15 10:23 PM
KeyInputMemory[column_count] = (uint16_t)(GPIOB->IDR);
uint16_t mask = 0x0FFF;
KeyInputMemory[column_count] &= mask;
if (KeyInputMemory[column_count] == StoredKeyInput[column_count]) { //
KeyInputCounter[column_count]++;
if (KeyInputCounter[column_count] > 5) {
StoredKeyInput[column_count] = KeyInputMemory[column_count];
// Reset the counter
//KeyInputCounter[column_count] = 0;
}
} else {
// Store the current key input into the column stored key input
StoredKeyInput[column_count] = KeyInputMemory[column_count];
// Clear the key input count
KeyInputCounter[column_count] = 0;
//EXIT
return;
} I have physical keyboard i have to read b port but not detecting is my logic is true or false....... whenever key is pressed not reading the values
2023-10-16 03:41 AM
Hello @Girish1
Would you provide more details about the issue? If possible, add more context about your Hardware setup, attach your IOC file/configuration.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-10-16 07:23 AM
The code doesn't make a whole lot of sense here. You're comparing 12 different bits in the code. I suspect you want to look at a single bit instead.
Suggest using HAL_GPIO_ReadPin instead if you're not comfortable with bitwise manipulation.