Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

#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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 2 Lncs 13427

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124251, 978-3031124259

More Books

Students also viewed these Databases questions

Question

9. System creates a large, diverse talent pool.

Answered: 1 week ago