Question: This is a code on mbed that displays the numbers 0 1 2 3 in sequence using a seven segment display. Please write the same

This is a code on mbed that displays the numbers 0 1 2 3 in sequence using a seven segment display. Please write the same code to display 3, 5, and 7 but using if/else if statements instead of a switch statement. Thank You.

BusOut display(p5,p6,p7,p8,p9,p10,p11,p11,p12);

int main() { while(1) { for(int i=0; i<4; i++) { switch (i){ case 0: display = 0x3F; break; case 1: display = 0x06; break; case 2: display = 0x5B; break; case 3: display = 0x4F; break;

}

wait(0.2);

}

}

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!