# change '.txt' to '.py' for execution ##automatic data aquisition unit program ## Ext-ins technologies import smbus import serial import time b = smbus.SMBus(1) b.write_byte_data(0x20,0xff,0xff) b.read_byte(0x20) #write_i2c_block_data(0x20, ser = serial.Serial( port='/dev/ttyUSB0', baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, timeout=1) #b.write_byte_data(0x20,0xff,0xff) fid= open('file.txt', 'w') y=-1 x=0 print ('press + c once to stop (may take a while)') #for x in xrange(1,1000): try: while True: x=x+1 if y < 4: y=y+1 else: y = 0; time.sleep(600) #tijd stussen de volgende metingen if x==100: fid.flush() print ('file flushed') b.write_byte_data(0x20,~(1<