Skip to content
Snippets Groups Projects
Commit a7cef8ca authored by Gijs Schoonderbeek's avatar Gijs Schoonderbeek
Browse files

Tested on HW, now working

parent 5ccc38e7
Branches
Tags
1 merge request!2Modified the scripts to run on Raspberry Pi.
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment