File tree Expand file tree Collapse file tree 5 files changed +31
-6
lines changed
Expand file tree Collapse file tree 5 files changed +31
-6
lines changed Original file line number Diff line number Diff line change 11Change Log
22==========
33
4+ v0.8.1
5+ ------
6+ - Figures out default serial port for Raspberry Pi 2 and below,
7+ Raspberry Pi 3 and above and MacOS.
8+
49v0.8.0
510------
611- Added servo support.
Original file line number Diff line number Diff line change 66from codebug_tether .serial_channel_device import SerialChannelDevice
77
88
9- DEFAULT_SERIAL_PORT = '/dev/ttyACM0'
9+ # setup default serial port (different on MacOS and >=Raspberry Pi 3)
10+ if os .uname ().sysname == 'Darwin' :
11+ # OSX
12+ DEFAULT_SERIAL_PORT = '/dev/tty.USBmodem'
13+ else :
14+ # assume we're on Raspberry Pi/Linux
15+ def get_rpi_revision ():
16+ """Returns the version number from the revision line."""
17+ for line in open ("/proc/cpuinfo" ):
18+ if "Revision" in line :
19+ import re
20+ return re .sub ('Revision\t : ([a-z0-9]+)\n ' , r'\1' , line )
21+
22+ rpi_revision = get_rpi_revision ()
23+ if rpi_revision and rpi_revision != 'Beta' and int ('0x' + rpi_revision , 16 ) >= 0xa02082 :
24+ # RPi 3 and above
25+ DEFAULT_SERIAL_PORT = '/dev/ttyS0'
26+ else :
27+ # RPi 2 and below
28+ DEFAULT_SERIAL_PORT = '/dev/ttyACM0'
29+
1030
1131IO_DIGITAL_OUTPUT = 0
1232IO_DIGITAL_INPUT = 1
Original file line number Diff line number Diff line change 1- __version__ = '0.8.0 '
1+ __version__ = '0.8.1 '
Original file line number Diff line number Diff line change 5050#
5151# The short X.Y version.
5252# The short X.Y version.
53- version = '0.8.0 '
53+ version = '0.8.1 '
5454# The full version, including alpha/beta/rc tags.
55- release = '0.8.0 '
55+ release = '0.8.1 '
5656
5757# The language for content autogenerated by Sphinx. Refer to documentation
5858# for a list of supported languages.
Original file line number Diff line number Diff line change 3838
3939
4040.. note :: You can specify a different serial device for CodeBug by passing
41- the class a string. For example, OSX users might use :
42- ``codebug = codebug_tether.CodeBug('/dev/tty.USBmodem') ``.
41+ the class a string. For example:
42+ ``codebug = codebug_tether.CodeBug(serial_port= '/dev/tty.USBmodem') ``.
4343
4444
4545Sprites
You can’t perform that action at this time.
0 commit comments