some current detection fix
This commit is contained in:
parent
8f73f3edb3
commit
d7fe4f0345
4
openpdud
Normal file → Executable file
4
openpdud
Normal file → Executable file
@ -354,7 +354,7 @@ class BoardI2Ccurrent(object):
|
||||
cfg_amplifier = 0b000
|
||||
|
||||
# 0 = continuous conversion / 1 = single-shot or power-down
|
||||
cfg_mode = 0
|
||||
cfg_mode = 1
|
||||
|
||||
# data rate
|
||||
# 000 = 128 sps
|
||||
@ -383,7 +383,7 @@ class BoardI2Ccurrent(object):
|
||||
# 11 = disable comparator
|
||||
cfg_comp_queue = 0b11
|
||||
|
||||
config = cfg_OS << 15 | cfg_chan << 12 | cfg_amplifier << 9 | cfg_mode << 8 | cfg_sps << 5 | cfg_comp << 4 | cfg_comp_pol << 3 | cfg_comp_latch << 2 | cfg_comp_queue
|
||||
config = cfg_sps << 13 | cfg_comp << 12 | cfg_comp_pol << 11 | cfg_comp_latch << 10 | cfg_comp_queue << 8 | cfg_OS << 7 | cfg_chan << 4 | cfg_amplifier << 1 | cfg_mode
|
||||
|
||||
self._bus.write_word_data(self.address, 0x01, config)
|
||||
while True:
|
||||
|
Loading…
Reference in New Issue
Block a user