51 single-chip microcomputer Puzhong V2 traffic light based on physical simulation

Suitable for Puzhong V2 board
Insert picture description here

/*

  • D7 D8 discarded
  • 1111 1111
  • 1110 1110
  • 1110 1011
  • 1111 0101
  • 1101 1101
  • 0~25 seconds D5 is on, D1 is on, D3 is not on 0xee
  • 25~30 seconds D5 is on, D1 is not on, D3 is on, 0xeb
  • 30~55 seconds D2 is on, D4 is on, D6 is off, 0xf5
  • 55~60 seconds D2 is on, D4 is not on, D6 is on, 0xdd
  • Loop~
  • Digital tube display countdown time
  • Each of the 8 digital tubes has two directions: east, west, south, north
  • 0~25 seconds
  • 25~30 seconds
  • 30~55 seconds
  • 55~60 seconds
  • 1111 1111
  • 1110 1101 0xed
  • 1110 1110 0xee
  • 1111 0101 0xf5
  • After the button k1 is pressed, d2 and d5 will light up, and the time will not stop. Press k1 again to return to normal.
  • After the button k2 is pressed, d1 and d5 will light up and the time will not go after a pause. Press the k2 button again to return to normal.
  • After the button k3 is pressed, d4 ​​and d2 will light up, and the time will not go after a pause. Press the k3 button again to return to normal

*/
Insert picture description here

Guess you like

Origin blog.csdn.net/x1131230123/article/details/108555515