Skip to content

Commit

Permalink
Vernier read single pts 500 Hz
Browse files Browse the repository at this point in the history
  • Loading branch information
gutow committed May 1, 2023
1 parent e0877d7 commit bb1defc
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions jupyterpidaq/Boards/vernier/labquest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Optimized for Pi 3B+ for an installed ADS1115 ADC PiHAT. This is
# actually ignored by this board, but necessary for ADC call
# compatibility.
RATE = 10000 #maximum 10 kHz
RATE = 500 #maximum 10 kHz

def find_boards():
"""
Expand Down Expand Up @@ -299,19 +299,17 @@ def LQProc(cmdrcv, datasend, starttime, samples):
running = False
if cmd[0] == 'start':
# restart data collection to get good zero
#lqs.stop()
#lqs.start(PERIOD)
print("Reached start.")
labquest.buf.buffer_clear()
now = time.time()
starttime.value = now
lqs.stop()
lqs.start(PERIOD)
starttime.value = time.time()
for k in range(3):
samples[k].value = 0
print(" Time should set to: "+str(now))
if cmd[0] == 'send':
# return requested amount of data for the channel
chan = 'ch'+str(cmd[2])
data = lqs.read_multi_pt(chan,cmd[3],device=cmd[1])
data = []
for k in range(cmd[3]):
data.append(lqs.read(chan, device=cmd[1]))
datasend.send(data)
lqs.close()
return
Expand Down

0 comments on commit bb1defc

Please sign in to comment.