Question: 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 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
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... View full answer
Get step-by-step solutions from verified subject matter experts
