Jesus 5 年 前
コミット
f744668ae0
1 ファイル変更11 行追加8 行削除
  1. 11 8
      pi/server.py

+ 11 - 8
pi/server.py

@@ -8,7 +8,7 @@ import os
 
 import eel # GUI
 
-#from ADUCv2p1 import * # TO DO
+from ADUCv2p1 import *
 
 ###################################
 ## PYTHON UTILITIES
@@ -438,15 +438,18 @@ import re
 chips = []
 adresses = []
 # TO DO
-'''
 p = subprocess.Popen(['i2cdetect', '-y','1'],stdout=subprocess.PIPE,)
-for i in range(0,9):
-	line = str(p.stdout.readline())[2:]
+p.stdout.readline()
+for i in range(0,8):
+	line = str(p.stdout.readline())[4:]
+	print(line)
 	for match in re.finditer("[0-9a-f]+", line):
-		adresses.append(int(match, 16))
-		chips.append(ADUCv2p1(int(match, 16),True))
+		print(match)
+		adresses.append(int(match.group(0), 16))
+		chips.append(ADUCv2p1(int(match.group(0), 16),True))
+print('Found boards', chips)
 update_state()
-'''
+
 	
 	
 
@@ -458,7 +461,7 @@ while(True):
 	# save_waveform() # TO DO
 	eel.sleep(1/state["pi_freq"])
 	if(i%100==0):
-		clean_old_files("/data/waveforms", 1000)
+		clean_old_files("data/waveforms", 1000)
 	i += 1