diff --git a/check_adc_lock.py b/check_adc_lock.py index 97eec85eccd9d45ddd262f5557d59fa2dcf72e3b..294ac49c726f4566681dd93e0e1d8e4eaee7b126 100644 --- a/check_adc_lock.py +++ b/check_adc_lock.py @@ -41,7 +41,7 @@ def Read_byte_ADC(ADC_reg_address, ADC_bytes=0, ADC_NR = 0, ADDRESS=0x20 ): # # Read Byte from the ADC # - I2C_device = I2C(ADDRESS, , BUSNR=I2CBUSNR) + I2C_device = I2C(ADDRESS, BUSNR=I2CBUSNR) ADC_rw = 0x01 # 0 for write, 1 for read stri = "Read ADC from Address {:8x}".format(ADC_reg_address) @@ -86,19 +86,15 @@ def Read_byte_ADC(ADC_reg_address, ADC_bytes=0, ADC_NR = 0, ADDRESS=0x20 ): -i for cnt in range(3): if SET_ADC : ADC_address = 0x3A # see address table ADC_data = 0x00 # 8 bits data ADC_bytes = 0x00 # 00 / 11 + 1 bytes ADCNR = ADC_ORDER[cnt] - set_gain(10, ADCNR) - stri = "Set channel {}".format(ADCNR) - print(stri) data = Read_byte_ADC(0x0A, ADC_NR = ADCNR) - if data == "0x81": + if data == "10000001": print("ADC locked") else: print("ADC not locked")