Beispiel #1
0
	def _setFrequency(self, freq):
		"""Set frequency of pwm-exp oscillator"""
		self.frequency 	= freq
		ret 	= pwmExp.setFrequency(freq);
		if (ret != 0):
			print 'ERROR: pwm-exp setFrequency not successful!'

		return ret
Beispiel #2
0
import OmegaExpansion.pwmExp as pwm
import sys

status = pwm.driverInit()

if pwm.checkInit() == 0:
    print("PWM Init failed")
    exit

lr = float(sys.argv[1])
ud = float(sys.argv[2])

pwm.setFrequency(50)
pwm.setupDriver( 0, lr, 0)
pwm.setupDriver(15, ud, 0)
Beispiel #3
0
print '>> Using channel ', channel

pwmExp.setVerbosity(0)

# check initialization
#	should return 0 if the PWM Expansion has just been plugged in
ret 	= pwmExp.checkInit()
print "checking if initialized: ", ret

# initialize the pwm-exp
ret 	= pwmExp.driverInit()
print "driverInit return: ", ret
if (ret != 0):
	exit()
ret 	= pwmExp.setFrequency(50)	
print "setFrequency return: ", ret
if (ret != 0):
	exit()

# check initialization
#	should return 1 since the Expansion was initialized above
ret 	= pwmExp.checkInit()
print "checking if initialized: ", ret
time.sleep(1)


# set channel 0
ret 	= pwmExp.setupDriver(channel, 9, 0)
print "setupDriver return: ", ret
if (ret != 0):