Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions pyfirmata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,27 @@ def __init__(self, *args, **kwargs):

def __str__(self):
return "Arduino Nano {0.name} on {0.sp.port}".format(self)

class ArduinoMicro(Board):
"""
A board that will set itself up as an Arduino Due.
"""
def __init__(self, *args, **kwargs):
args = list(args)
args.append(BOARDS['arduino_micro'])
super(ArduinoMicro, self).__init__(*args, **kwargs)

def __str__(self):
return "Arduino Micro {0.name} on {0.sp.port}".format(self)

class ArduinoLeonardo(Board):
"""
A board that will set itself up as an Arduino Due.
"""
def __init__(self, *args, **kwargs):
args = list(args)
args.append(BOARDS['arduino_leonardo'])
super(ArduinoLeonardo, self).__init__(*args, **kwargs)

def __str__(self):
return "Arduino Leonardo {0.name} on {0.sp.port}".format(self)
14 changes: 14 additions & 0 deletions pyfirmata/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,19 @@
'pwm': (3, 5, 6, 9, 10, 11),
'use_ports': True,
'disabled': (0, 1) # Rx, Tx, Crystal
},
'arduino_leonardo': {
'digital': tuple(x for x in range(17)),
'analog': tuple(x for x in range(14)),
'pwm': (3, 5, 6, 9, 10, 11, 12, 13),
'use_ports': True,
'disabled': () # Rx, Tx, Crystal
},
'arduino_micro': {
'digital': tuple(x for x in range(17)),
'analog': tuple(x for x in range(14)),
'pwm': (3, 5, 6, 9, 10, 11, 12, 13),
'use_ports': True,
'disabled': () # Rx, Tx, Crystal
}
}