Skip to content

Reading from serial with dut.expect() #270

Closed Answered by igrr
KaDw asked this question in Q&A
Discussion options

You must be logged in to vote

Perhaps you could do

match = dut.expect(r'adcval=([0-9.]+)V\nOperation successful')
value = match.group(1)

(I didn't check whether this regex works for your output, but hopefully this illustrates the idea.)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by KaDw
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants