Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

EECE 3225 Isaistool 7. Programming Assignment #2tiu d bolo laman Hint: you can single out particular bits using the binary bitwise and operator &:

EECE 3225 Isaintool 7. Programming Assignment #2 tiau yd bolo laman Hint: you can single out particular bitsGroups E,F: Write a program that configures two pins on PORTB as inputs, which we will call X1 and X2, each

EECE 3225 Isaistool 7. Programming Assignment #2tiu d bolo laman Hint: you can single out particular bits using the binary bitwise and operator &: x = PORTC; if ((PORTC & 0b00000100) != 0) { Electrical Engineering Lab I } else { } Also, you can shift bits left or right by dividing or multiplying by a power of 2. Groups E,F: Write a program that configures two pins on PORTB as inputs, which we will call X1 and X2, each connected to a pushbutton, and PORTD as an output. The program should have an internal counter that updates twice per second (once every 500ms) and displays the result on a seven segment display as a hex number (0 through F), driven by PORTD through resistors. An external BCD to 7 segment integrated circuit is NOT needed and should not be used. If X1 is depressed, the counter should increment by one each count, rolling over to 0 after it counts to F. If X2 is depressed, the counter should decrement by one each count, rolling back to F after it counts down to If neither is depressed, the counter should freeze at its current value. If both are depressed, the display should flash E T r o "r" in a repeating sequence to indicate an error. The program should have a while (1) loop so that it repeatedly reads the input changes behavior when the inputs change.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Based on the provided description here is an example program that meets the requirements for configuring pins on PORTB as inputs and PORTD as an outpu... 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

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions