Introduction - If you have any usage issues, please Google them yourself
Wei satisfied with this program 300A type experiment board, photoelectric rotary encoder to detect the actual number of output pulses per week. Program, the timer 0 for 8 digital tube dynamic scanning time, and time is 1ms (12MHZ crystal). Timer 1 in Mode 1, the counter mode, direct measurement of the pulse connected to the T1 pin number. External Interrupt 0, work on the edge trigger mode, then the Z in the rotary encoder signal output on the encoder used to detect a complete one revolution. 8-bit digital tube connected to a dynamic scan, connected to the P0 and P2 ports. Left 4 to display the actual number of pulses on the week, right four, used to display the current week number of pulses.