Skip to content

Implement iterator and context #24

@mjuenema

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

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions