Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Jeremy Herbert
    I just got my treehoppers
    but I'm having an issue
    I'm running the following code
    inp = 0x01 for i, pin in enumerate(board.pins[10:18]): print(pin) pin.digital_value = bool(inp & (1<<i))
    inp = 0x01
    for i, pin in enumerate(board.pins[10:18]):
        pin.digital_value = bool(inp & (1<<i))
    I have pins 10 to 17 hooked up to my logic analyser
    I expect 0x01 to be output
    but instead I get 0x00
    if I output 0x05
    same problem
    however, if I output 0x10, I get 0x18
    0x20 outputs 0x24
    0x40 outputs 0x42
    0x80 outputs 0x81
    so clearly, the lower nibble is being ignored, and the upper nibble is being mirrored to the lower half of the byte
    Jeremy Herbert
    the python code appears to be printing the correct stuff
    Pin 10: Digital push-pull, False
    Pin 11: Digital push-pull, False
    Pin 12: Digital push-pull, False
    Pin 13: Digital push-pull, False
    Pin 14: Digital push-pull, False
    Pin 15: Digital push-pull, False
    Pin 16: Digital push-pull, True
    Pin 17: Digital push-pull, False
    (that's for 0x40)
    so it looks like this might be a firmware bug
    Jay Carlson
    Interesting! I'll take a look when I get back to a computer and see what's going on.
    Jay Carlson
    @jeremyherbert, this sounds like an old bug. What firmware version are you running? I don't (yet) have a Python API for accessing firmware version, but your operating system can tell you the revision of the device. In Windows Device Manager:
    with Linux, dmesg should list the revision when you first attach the device
    in macOS, you should be able to visit System Information to retrieve the device revision
    It's entirely plausible that I accidentally sent you beta test boards with an incorrect firmware :-/
    Jay Carlson
    I'm away right now, and don't have any boards with me, but I glanced through the firmware source code and didn't see any obvious bugs. Tonight I'll plan to duplicate your setup. One other thing I might have you try is the Treehopper App, available at https://treehopper.io/downloads/, which should eliminate any hidden Python bugs.
    Jeremy Herbert
    according to system info on my mac
    version 1.12
    i will try the app now
    Jeremy Herbert
    yep app does exactly the same thing
    Jeremy Herbert
    ok well
    i took everything out of the breadboard