|
3 | 3 | import time # imports the time library |
4 | 4 |
|
5 | 5 |
|
6 | | -# Variable Declaration |
7 | | - |
8 | | - |
9 | 6 | # Initialise the program settings and configurations |
10 | | - |
11 | 7 | eb = ElectroBlocks() # Create an instance of the ElectroBlocks class |
12 | | -eb.config_motor(11, 10, 9, 3, 4, 5) |
| 8 | +eb.config_motor(9, 8, 7, 3, 5, 4) |
13 | 9 |
|
14 | | -for _ in range(1, 4): |
15 | | - eb.move_motor(1, 200, "clockwise") |
16 | | - time.sleep(1) |
17 | | - eb.stop_motor(1) |
18 | | - eb.move_motor(2, 200, "clockwise") |
19 | | - time.sleep(1) |
20 | | - eb.stop_motor(2) |
21 | | - time.sleep(1) |
22 | | - eb.move_motor(1, 200, "anticlockwise") |
23 | | - time.sleep(1) |
24 | | - eb.stop_motor(1) |
25 | | - eb.move_motor(2, 200, "anticlockwise") |
26 | | - time.sleep(1) |
27 | | - eb.stop_motor(2) |
28 | | - time.sleep(1) |
| 10 | +while True: |
| 11 | + eb.move_motor(1, 150, "clockwise") |
| 12 | + time.sleep(3) # Wait for the given/defined seconds. |
| 13 | + eb.stop_motor(1) |
| 14 | + time.sleep(3) # Wait for the given/defined seconds. |
| 15 | + eb.move_motor(1, 150, "anti_clockwise") |
| 16 | + time.sleep(3) # Wait for the given/defined seconds. |
| 17 | + eb.stop_motor(1) |
| 18 | + time.sleep(3) # Wait for the given/defined seconds. |
| 19 | + eb.move_motor(2, 150, "clockwise") |
| 20 | + time.sleep(3) # Wait for the given/defined seconds. |
| 21 | + eb.stop_motor(2) |
| 22 | + time.sleep(3) # Wait for the given/defined seconds. |
| 23 | + eb.move_motor(2, 150, "anti_clockwise") |
| 24 | + time.sleep(3) # Wait for the given/defined seconds. |
| 25 | + eb.stop_motor(2) |
| 26 | + time.sleep(3) # Wait for the given/defined seconds. |
0 commit comments