id = 'graycode'
name = 'Gray code'
longname = 'Gray code and rotary encoder'
- desc = 'Accumulate rotary encoder increments, provide timing statistics.'
+ desc = 'Accumulate rotary encoder increments, provide statistics.'
license = 'gplv2+'
inputs = ['logic']
outputs = ['graycode']
+ tags = ['Encoding']
optional_channels = tuple(
{'id': 'd{}'.format(i), 'name': 'D{}'.format(i), 'desc': 'Data line {}'.format(i)}
for i in range(MAX_CHANNELS)
if self.options['edges']:
self.turns.set(self.samplenum, self.count.get() // self.options['edges'])
- if self.samplerate is not None:
+ if self.samplerate:
period = (curtime - prevtime) / self.samplerate
freq = abs(phasedelta_raw) / period