forked from tino/pyFirmata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
61 lines (46 loc) · 1.63 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from .boards import BOARDS
from .pyfirmata import * # NOQA
# TODO: should change above import to an explicit list, but people might rely on
# it, so do it in a backwards breaking release
__version__ = '1.1.0' # Use bumpversion!
# shortcut classes
class Arduino(Board):
"""
A board that will set itself up as a normal Arduino.
"""
def __init__(self, *args, **kwargs):
args = list(args)
args.append(BOARDS['arduino'])
super(Arduino, self).__init__(*args, **kwargs)
def __str__(self):
return "Arduino {0.name} on {0.sp.port}".format(self)
class ArduinoMega(Board):
"""
A board that will set itself up as an Arduino Mega.
"""
def __init__(self, *args, **kwargs):
args = list(args)
args.append(BOARDS['arduino_mega'])
super(ArduinoMega, self).__init__(*args, **kwargs)
def __str__(self):
return "Arduino Mega {0.name} on {0.sp.port}".format(self)
class ArduinoDue(Board):
"""
A board that will set itself up as an Arduino Due.
"""
def __init__(self, *args, **kwargs):
args = list(args)
args.append(BOARDS['arduino_due'])
super(ArduinoDue, self).__init__(*args, **kwargs)
def __str__(self):
return "Arduino Due {0.name} on {0.sp.port}".format(self)
class ArduinoNano(Board):
"""
A board that will set itself up as an Arduino Nano.
"""
def __init__(self, *args, **kwargs):
args = list(args)
args.append(BOARDS['arduino_nano'])
super(ArduinoNano, self).__init__(*args, **kwargs)
def __str__(self):
return "Arduino Nano {0.name} on {0.sp.port}".format(self)