Skip to content

Implement iterator and context #24

Description

@mjuenema
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])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions