Question: Scanning a keyboard using Disco STM32L476 board and C language. 1. Describe the 4 pin input modes. For example: void mbed::DigitalIn::mode ( PinMode pull )

Scanning a keyboard using Disco STM32L476 board and C language.

1. Describe the 4 pin input modes. For example: void mbed::DigitalIn::mode ( PinMode pull )

2. What would you have to do the set the output GPIO speed setting?

3. Describe why the code is able to detect individual keys when in a 4x3 matrix.

Scanning a keyboard using Disco STM32L476 board and C language. 1. Describe

#include "mbed.h" #include using namespace std; DigitalIn C[31 PA 2, PA 1, PA 57; DigitalOut R[4]-PD_0, PB_7, PB_6, PA 3; DigitalOut led (LED1); char NumPad [4] [31 1; char lookups [61'2,'0', '1', '6','#; char input [6]; int count 0; int main() C[0].mode (PullUp); C[1].mode (PullUp); C[2].mode (PullUp); char read [3]-'0'; while (1) for(int i-0; iwait(.005); while(C[j]=-0); if (strcmp (Lookups.input)0) led-1; else if(read [0]=NumPad [3] [0]) led 0; input [0]='a' ; input [4]-'e count-0; input [1]='b' ; input [2]='c' ; input [3]=d' ; #include "mbed.h" #include using namespace std; DigitalIn C[31 PA 2, PA 1, PA 57; DigitalOut R[4]-PD_0, PB_7, PB_6, PA 3; DigitalOut led (LED1); char NumPad [4] [31 1; char lookups [61'2,'0', '1', '6','#; char input [6]; int count 0; int main() C[0].mode (PullUp); C[1].mode (PullUp); C[2].mode (PullUp); char read [3]-'0'; while (1) for(int i-0; iwait(.005); while(C[j]=-0); if (strcmp (Lookups.input)0) led-1; else if(read [0]=NumPad [3] [0]) led 0; input [0]='a' ; input [4]-'e count-0; input [1]='b' ; input [2]='c' ; input [3]=d

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!