return result_button_list;
}
+/* Scans the specified key and return true if pressed
+ It's more performant that scanning the whole keyboard */
+bool get_key(char row, uint8_t column){
+ for(int i = 0; i < number_of_rows; i++){
+ if(row==row_list[i]){
+ activate_row(i);
+ return(read_input_pin(GPIO_C, column));
+ }
+ }
+ return false;
+}
\ No newline at end of file
You can find the button struct definition in keyboard.h */
struct button* keyboard_scan();
+/* Scans the specified key and return true if pressed
+ It's more performant that scanning the whole keyboard */
+bool get_key(char row, uint8_t column);
+
#endif
\ No newline at end of file
// init all the peripherals
laplace_init();
ms_wait(2000);
- set_led_green(true);
// infinite loop
while (1){
+ /*
struct button * keyboard_state = keyboard_scan();
for(int i =0; i < 54; i++){
set_led_green(false);
}
}
- if(keyboard_state[i].column == 2 && keyboard_state[i].row == 'H'){
- if(keyboard_state[i].state){
- set_led_red(true);
- }else{
- set_led_red(false);
- }
- }
+ }*/
+
+ if(get_key('G', 3)){
+ set_led_red(true);
+ }else{
+ set_led_red(false);
}
}