Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of UranusTest by
Revision 3:98e614fc55c5, committed 2017-05-19
- Comitter:
- swxu
- Date:
- Fri May 19 17:48:11 2017 +0000
- Parent:
- 2:626c243adc03
- Commit message:
- add doc string
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri May 19 17:37:27 2017 +0000 +++ b/main.cpp Fri May 19 17:48:11 2017 +0000 @@ -3,6 +3,34 @@ #include <time.h> +/** +* Python script for high baud rate test on Host PC +* +* @code +* #!/usr/bin/env python +* +* import os +* import sys +* import serial +* +* PORT = '/dev/ttyUSB0' +* BAUD = 9600 +* +* def main(args): +* port = len(args) > 1 and args[1] or PORT +* baud = len(args) > 2 and args[2] or BAUD +* count = 0 +* with serial.Serial(port, baud) as s: +* while True: +* b = s.read() +* count += 1 +* sys.stdout.write('%x ' % b) +* sys.stdout.flush() +* if __name__ == '__main__': +* main(sys.argv) +* @endcode +*/ + DigitalOut led0(P0_20); DigitalOut led1(P0_21); DigitalOut led2(P0_11);