예제 #1
0
def check_message():
    print("Checking for message")

    resp = queue.get(max=1, timeout=None)
    messages = resp['messages']
    if (len(messages) > 0):
        message = messages[0]

        message_id = message['id']
        message_body = message['body']

        queue.clear()

        print("Rotating feeder")
        stepper.rotate(1024, 5, 2)
        time.sleep(2)
        stepper.rotate(1024, 5, 2)
예제 #2
0
def check_message():
  print("Checking for message")

  resp = queue.get(max=1, timeout=None)
  messages = resp['messages']
  if (len(messages) > 0):
    message = messages[0]

    message_id = message['id']
    message_body = message['body']

    queue.clear()

    print("Rotating feeder")
    stepper.rotate(1024,5,2)
    time.sleep(2)
    stepper.rotate(1024,5,2)
예제 #3
0
def wiggle(control_pins):
    stepper.rotate(control_pins,
                   angle=15,
                   direction=stepper.Direction.CounterClockWise)
    time.sleep(0.1)
    stepper.rotate(control_pins,
                   angle=15,
                   direction=stepper.Direction.ClockWise)
    time.sleep(0.1)
    stepper.rotate(control_pins,
                   angle=15,
                   direction=stepper.Direction.CounterClockWise)
    time.sleep(0.1)
    stepper.rotate(control_pins,
                   angle=15,
                   direction=stepper.Direction.ClockWise)
    time.sleep(0.1)
예제 #4
0
def turn_right():
    stepper.rotate(control_pins,
                   angle=90,
                   direction=stepper.Direction.CounterClockWise)
    head_position = HeadPosition.Right
예제 #5
0
def turn_left():
    stepper.rotate(control_pins,
                   angle=90,
                   direction=stepper.Direction.ClockWise)
    head_position = HeadPosition.Left
예제 #6
0
def lift_up(control_pins):
    stepper.rotate(control_pins,
                   angle=90,
                   direction=stepper.Direction.ClockWise)
예제 #7
0
def lift_down(control_pins):
    stepper.rotate(control_pins,
                   angle=90,
                   direction=stepper.Direction.CounterClockWise)