Introduction
- Connections
- Example
(30 minutes)
Connections
Display the number 123 on the three 7segment displays
The right display should be enabled (C0=1, C1=0, C2=0).
Then send to PORTB the code to display 3.
The above state should remain for 5 ms.
The middle display (C0=0, C1=1, C2=0) should be activated.
Then send to PORTB the code to display 2.
The above state should remain for 5 ms
The left display should be enabled (C0=0, C1=0, C2=1).
Then send to PORTB the code to display 1
The above state should remain for 5 ms
The above steps will be repeated continuously, so you should get inside a while(TRUE).
We need to find the code to display each of the following digits:1 2 3
For 1 to appear sectors b and c should be on, so PORTB should be sent the value 000 00110 (dp-g-f-e-d-c-b-a)
For 2 to appear sectors a, b, g and e should be on, so PORTB should be sent the value 0101 1011 (dp-g-f-e-d-c-b-a)
For 3 to appear sectors a, b, c, d, g should be on, so PORTB should be sent the value 01001111 (dp-g-f-e-d-c-b-a)