def is_it_on(): if cyprus.read_gpio() & 0b0001: cyprus.set_servo_speed(1, 0) sleep(0.05) else: cyprus.set_servo_position(1, 0) sleep(0.05)
def ramp_up(self): cyprus.initialize() cyprus.setup_servo(1) for i in range(2, 4, 6, 8, 10): cyprus.set_servo_speed(1, i/10.0) sleep(4) cyprus.set_servo_position(1, 0.5) cyprus.close()
def talon_switch(self): cyprus.initialize() cyprus.setup_servo(1) def isGPIO_P6_HIGH(self): return (cyprus.read_gpio() & 0b0001) == 1 if isGPIO_P6_HIGH(self): cyprus.set_servo_speed(1, 0) else: cyprus.set_servo_speed(1, 1)
def talon_dc(self): cyprus.initialize() cyprus.setup_servo(1) cyprus.set_servo_speed(1, 1) sleep(1) cyprus.set_servo_speed(1, 0) sleep(5) cyprus.set_servo_speed(1, -1) sleep(1) cyprus.set_servo_speed(1, 0) cyprus.close()
def talon_program(): speed_list = [1, 0, -1] for i in speed_list: cyprus.set_servo_speed(1, i) sleep(5) cyprus.set_servo_speed(1, 0)
def go_to_loop(): for i in np.arange(0, 21, 1): cyprus.set_servo_speed(1, i / 10) sleep(1) cyprus.set_servo_speed(1, 0) sleep(0.05)
def setup(): cyprus.initialize() cyprus.setup_servo(1) cyprus.set_servo_speed(1, 0) sleep(0.05)