|
| | pin_E1CH1 = pyb.Pin(pyb.Pin.cpu.B6) |
| | The pin object connected to Encoder 1's channel 1. More...
|
| |
| | pin_E1CH2 = pyb.Pin(pyb.Pin.cpu.B7) |
| | The pin object connected to Encoder 1's channel 2. More...
|
| |
| | e1 = EncDriver('E1', pin_E1CH1, 1, pin_E1CH2, 2, 4, 1000, False) |
| | An encoder object representing the encoder attached to Motor 1. More...
|
| |
| | pin_E2CH1 = pyb.Pin(pyb.Pin.cpu.C6) |
| | The pin object connected to Encoder 2's channel 1. More...
|
| |
| | pin_E2CH2 = pyb.Pin(pyb.Pin.cpu.C7) |
| | The pin object connected to Encoder 2's channel 2. More...
|
| |
| | e2 = EncDriver('E2', pin_E2CH1, 1, pin_E2CH2, 2, 8, 1000, False) |
| | An encoder object representing the encoder attached to Motor 2. More...
|
| |
| | test_type = input('Running test or time test? (r/t): ') |
| | The test type used (running or timed) More...
|
| |
| | test_enc = input('Running test or time test? (A/B): ') |
| | The encoder selection for testing. More...
|
| |
| | start = utime.ticks_us() |
| |
| | pos = e2.get_position('deg') |
| |
| | stop = utime.ticks_us() |
| |
| | run_time = utime.ticks_diff(stop,start) |
| |
| | delta = e2.get_delta('deg') |
| |