Skip to content

Set leg output state #6

Closed
Closed

Description

@cymplecy

I don't seem able to set a leg's output state :(
I've tried this code but either I've mis-understood the cb.set_output function or it doesn't work
Help please :)

import os
import sys
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parentdir)

from codebug_tether import CodeBug
import time


if __name__ == '__main__':
    cb = CodeBug()
    cb.clear()
    for i in range(3):
            cb.set_output(0,True)
            time.sleep(1)
            cb.set_output(0,False)
            time.sleep(1)

Activity

  1. tompreston commented on Aug 17, 2015

    @tompreston
    Contributor

    Ah it looks like I forgot to add the set_leg_io method. It's in now - use it like so:

    cb = CodeBug()
    cb.set_leg_io(0, 0) # set leg 0 to output (0)
    cb.set_output(0, 1)
    
  2. tompreston commented on Aug 17, 2015

    @tompreston
    Contributor

    (also new firmware with this change)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions