PageRenderTime 436ms CodeModel.GetById 133ms app.highlight 3ms RepoModel.GetById 140ms app.codeStats 0ms

/pyfirmata/__init__.py

https://bitbucket.org/tino/pyfirmata/
Python | 30 lines | 17 code | 6 blank | 7 comment | 0 complexity | 75532904a9179f07c8819e571a4e1012 MD5 | raw file
 1from pyfirmata import *
 2from boards import BOARDS
 3
 4__version__ = '0.9.4'
 5
 6# shortcut classes
 7
 8class Arduino(Board):
 9    """
10    A board that wil set itself up as a normal Arduino.
11    """
12    def __init__(self, *args, **kwargs):
13        args = list(args)
14        args.append(BOARDS['arduino'])
15        super(Arduino, self).__init__(*args, **kwargs)
16        
17    def __str__(self):
18        return 'Arduino %s on %s' % (self.name, self.sp.port)
19    
20class ArduinoMega(Board):
21    """
22    A board that wil set itself up as an Arduino Mega.
23    """
24    def __init__(self, *args, **kwargs):
25        args = list(args)
26        args.append(BOARDS['arduino_mega'])
27        super(ArduinoMega, self).__init__(*args, **kwargs)
28    
29    def __str__(self):
30        return 'Arduino Mega %s on %s' % (self.name, self.sp.port)