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

Implement iterator and context #24

Open
mjuenema opened this issue Sep 26, 2017 · 0 comments
Open

Implement iterator and context #24

mjuenema opened this issue Sep 26, 2017 · 0 comments
Assignees
Milestone

Comments

@mjuenema
Copy link
Owner

with serial.Serial('/dev/ttyS0', 38400) as serial_conn:
    with tsip.GPS(serial_conn) as  gps_conn:    # context
       for report in gps_conn:                  # iterator
           if report[0] == 0x41:
               print 'GPS time of week .......: %f' % (report[1])
               print 'Extended GPS week number: %d' % (report[2])
               print 'GPS UTC offset .........: %f' % (report[3])
@mjuenema mjuenema added this to the 0.4.0 milestone Sep 26, 2017
@mjuenema mjuenema self-assigned this Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant