Light up the water lamp

There are three ways to light up the water lamp

1. One-by-one operation: that is, make the first light on, delay, then turn it off, delay, and then let the next light repeat the operation;

2. Use the array method to light up: first define an array, and store the numbers of the corresponding 8 lights (that is, 0xfe, 0xfd, 0xfb, 0xf7, 0xef, oxdf, 0xbf, 0x7f: in turn represent only the first light, the second Lights .... on), Zaili bus, light up eight lights in order;

3. Use shift method to light up: ( 1 ), use shift operation and bitwise OR operation to light up eight lamps in sequence;

(2) Include the intrins header file (which contains the shift function), use the corresponding left or right shift function to shift, and turn on eight lights in a cycle

Guess you like

Origin blog.csdn.net/qq_41379312/article/details/78835394