|
META TOPICPARENT |
name="Exercises" |
Seven Segment Display and Keypad
The Seven Segment Display and its TM1637 controller |
|
Carefully read the data sheet. |
|
< < | Write a driver implementing the serial protocol. Implement he driver as class TM1637 with the following methods: |
> > | Write a driver implementing the serial protocol. Implement the driver as class TM1637 with the following methods: |
|
- start_transfer: implements the start sequence (dio going low when clk is high)
- stop transfer: implements the "end of transfer" sequence (dio going high when clk is high)
- write_bit: write a single bit: with clk low, set dio to the bit value, then send a pulse (high followed by low) on the clk pin
- write byte: send 8 bits. After the eights bit, check the acknowledge signal. Switch dio to input, check acq, switch dio back to output after the falling edge of the nineth clock pulse
- display on: switch the display on: start_transfer, send display_on command, stop transfer
|
|
< < |
- create a table with the led setting of the seven segments. dp means decimal point, which is only used on the second digit, where it controls the following colon.
|
> > |
- create a table with the led setting of the seven segments for all hex digits and a clear digit (all segments off). dp means decimal point, which is only used on the second digit, where it controls the following colon.
|
|
A
--- |