ME 405
enc_driver Namespace Reference

Classes

class  EncDriver
 An encoder driver object. More...
 

Variables

 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')
 

Variable Documentation

◆ delta

enc_driver.delta = e2.get_delta('deg')

◆ e1

enc_driver.e1 = EncDriver('E1', pin_E1CH1, 1, pin_E1CH2, 2, 4, 1000, False)

An encoder object representing the encoder attached to Motor 1.

◆ e2

enc_driver.e2 = EncDriver('E2', pin_E2CH1, 1, pin_E2CH2, 2, 8, 1000, False)

An encoder object representing the encoder attached to Motor 2.

◆ pin_E1CH1

enc_driver.pin_E1CH1 = pyb.Pin(pyb.Pin.cpu.B6)

The pin object connected to Encoder 1's channel 1.

◆ pin_E1CH2

enc_driver.pin_E1CH2 = pyb.Pin(pyb.Pin.cpu.B7)

The pin object connected to Encoder 1's channel 2.

◆ pin_E2CH1

enc_driver.pin_E2CH1 = pyb.Pin(pyb.Pin.cpu.C6)

The pin object connected to Encoder 2's channel 1.

◆ pin_E2CH2

enc_driver.pin_E2CH2 = pyb.Pin(pyb.Pin.cpu.C7)

The pin object connected to Encoder 2's channel 2.

◆ pos

enc_driver.pos = e2.get_position('deg')

◆ run_time

enc_driver.run_time = utime.ticks_diff(stop,start)

◆ start

enc_driver.start = utime.ticks_us()

◆ stop

enc_driver.stop = utime.ticks_us()

◆ test_enc

enc_driver.test_enc = input('Running test or time test? (A/B): ')

The encoder selection for testing.

◆ test_type

enc_driver.test_type = input('Running test or time test? (r/t): ')

The test type used (running or timed)