Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 2 02_serial_to_gdrive.py results in NameError: name 'elapsed' is not defined #1

Open
jomoengineer opened this issue Jan 30, 2024 · 0 comments

Comments

@jomoengineer
Copy link

The code in the Chapter 2 02_serial_to_gdrive.py will not work as written.
The code will give the following error:

NameError: name 'elapsed' is not defined

The variable 'elapsed' should be elapsed_s
Ex:

start_s   = time.time()
elapsed_s = 0
while(elapsed < max_time_s):
  text   += serial_readline(ser)
  end_s   = time.time()
  elapsed = end_s - start_s

Should be:

start_s   = time.time()
elapsed_s = 0
while(elapsed_s < max_time_s):
  text   += serial_readline(ser)
  end_s   = time.time()
  elapsed_s = end_s - start_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant