Exemplo n.º 1
0
    description=
    'Example sketch that controls an LED strip via Spacebrew. It uses the 	LED Strip Python library for Adafruit\'s LPD8806 LED strips.'
)

# Define the server optional parameter
parser.add_argument('-s',
                    '--server',
                    nargs=1,
                    type=str,
                    default='sandbox.spacebrew.cc',
                    help='the spacesb server hostname')

# read all command line parameters
args = parser.parse_args()

pwm = PWM(0x40, debug=True)
pwm.setPWMFreq(250)

base_pos = 1024
bars = [0, 0, 0, 0]
bars_prev = [0, 0, 0, 0]


def updateBar1(val):
    updateBar(1, val)


def updateBar2(val):
    updateBar(2, val)

Exemplo n.º 2
0
	def connect (self, address):
		if self.debug: print "[connect:ServoDriver] connecting to the servo driver at i2c address ", address
		self.pwm = PWM(address, debug = self.debug)
		self.pwm.setPWMFreq(self.freq)