Pages

Thursday, March 28, 2013

Guzunty Pi 8p8i core PWM testing notes

Now I am checking out if the duty cycle (30 + 13) / 32 == 22/32 gives 1500 uS.  Indeed it does.  So I know I can drive a servo to its middle or neutral position by setting duty cycle 22/32.


# * Guzunty Pi 8p8i core PWM functions ****************************************

def TestPwmGuzuntyPi():

    ccwMax = 30
    cwMax = 13
    middle = 22

    PrintDoubleSpaceLine("*** Start testing Guzunty Pi ***")

    spiGuzuntyPi = spidev.SpiDev()
    spiGuzuntyPi.open(0, 0)  

    pwmDutyCycleTuple = middle, middle, middle, middle, middle, middle, middle, middle

    for i in range(8):
        pwmDutyCycleList = [i, pwmDutyCycleTuple[i]]
        pwmDutyCycleList = spiGuzuntyPi.xfer2(pwmDutyCycleList)

    spiGuzuntyPi.close()

    PrintDoubleSpaceLine("*** Stop testing Guzunty Pi ***")



.END

No comments:

Post a Comment