Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 - General purpose I/O with a Keypad [25 pts] In this question, you are going to use the DDR, PORT, and PIN registers from

image text in transcribedimage text in transcribedimage text in transcribed

1 - General purpose I/O with a Keypad [25 pts] In this question, you are going to use the DDR, PORT, and PIN registers from your AVR device (the register definitions are the same as your AVR device) with a 3x3 keypad. You use 6 pins from Port C as shown below: PCO PC1 PC2 PC3 1 2 3 PC4 4 5 6 PC5 7 8 Note: You can ignore button bounce effects. Based on this description, a) [10 pts] Implement the keypad initialization function below that initializes the ports and pins (i.e. setting pins input vs. output, setting the pull-up property, etc.). void keypad_init() { } b) [15 pts] Implement the keypad scan function below that continuously scans the keypad, and returns the character corresponding to the pressed button. char keypad_scan) 1/ keypad character array const char keypad[3] [3] ={{'1','2','3'}, {'4', '5', '6'}, {'7', '8', '9'}}; while (1) } } 1 - General purpose I/O with a Keypad [25 pts] In this question, you are going to use the DDR, PORT, and PIN registers from your AVR device (the register definitions are the same as your AVR device) with a 3x3 keypad. You use 6 pins from Port C as shown below: PCO PC1 PC2 PC3 1 2 3 PC4 4 5 6 PC5 7 8 Note: You can ignore button bounce effects. Based on this description, a) [10 pts] Implement the keypad initialization function below that initializes the ports and pins (i.e. setting pins input vs. output, setting the pull-up property, etc.). void keypad_init() { } b) [15 pts] Implement the keypad scan function below that continuously scans the keypad, and returns the character corresponding to the pressed button. char keypad_scan) 1/ keypad character array const char keypad[3] [3] ={{'1','2','3'}, {'4', '5', '6'}, {'7', '8', '9'}}; while (1) } }

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

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

What bulleted text will you include under each main point?

Answered: 1 week ago