def set_gain_A(self, gain):
if gain == 128:
self._gain_channel_A = gain
elif gain == 64:
self._gain_channel_A = gain
else:
raise ValueError('gain has to be 128 or 64.\nI have got: '
+ str(gain))
# after changing channel or gain it has to wait 50 ms to allow adjustment.
# the data before is garbage and cannot be used.
self._read()
time.sleep(0.5)
return True
############################################################
# zero is function which sets the current data as #
# an offset for particulart channel. It can be used for #
# subtracting the weight of the packaging. #
# max value of times parameter is 99. min 1. Default 10. #
# INPUTS: times # how many times do reading and then mean #
# OUTPUTS: BOOL # if True it is OK #
############################################################
评论列表
文章目录