def __init__(self): logi_hal.setGPIODir(GPIO_ADDR, 0x0007) logi_hal.setGPIOVal(GPIO_ADDR, 0x0006) logi_hal.setPWMDivider(PWM_ADDR, 0x003F) logi_hal.setPWMPeriod(PWM_ADDR, self.pwm_period)
import sys sys.path.append("/home/ubuntu/logi-tools/python/") import time,math import logi_hal gpio_0=0x0000 logi_hal.setGPIODir(gpio_0,0x2) logi_hal.setGPIOVal(gpio_0,0x2) #beaglebone下,运行sudo python gpio.py