🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    File "base/stepmotor.py", line 1, in __init__ ValueError: invalid pin

    Bases
    2
    5
    77
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Schnoble
      last edited by

      Hi everyone

      I am trying to use an Atomic stepmotor base (SKU:A132) with an Atom lite (SKU:C008) Uiflow2.0 (v2.2.8) but it does not work.
      I get this error message :
      File "base/stepmotor.py", line 1, in init ValueError: invalid pin
      I think pins are sets correctly :

      38d1dcce-b905-4aae-a05e-d21985540e9c-image.png

      base_stepmotor = AtomicStepmotorBase(22, 23, 19, 25, 21)
      

      15997103-342b-4b44-b740-150df10abb9a-image.png

      I do not understand why it's throwing error and what i am doing wrong ?

      felmueF S 2 Replies Last reply Reply Quote 0
      • felmueF
        felmue @Schnoble
        last edited by felmue

        Hello @Schnoble

        you are not doing anything wrong I think. The issue is with UIFlow2 firmware for M5AtomLite. As far as I can tell the default pins are for M5AtomS3 (Lite) and there is one additional pin, which cannot be set from the init block and it is set to a GPIO (8) only available in S3. See here.

        BTW: I've created a PR for the issue. So hopefully it will be fixed in a future firmware version.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        S 1 Reply Last reply Reply Quote 0
        • S
          Schnoble @felmue
          last edited by

          Thanks @felmue
          Let's hope

          1 Reply Last reply Reply Quote 0
          • S
            Schnoble @Schnoble
            last edited by

            For what it worth, I make it work by switching to micropython and replacing

            from base import AtomicStepmotorBase
            

            by a modified version of stepmotor.py before downloading the code

            If you like using blockly, you need to paste modification each time though...

            felmueF 1 Reply Last reply Reply Quote 1
            • felmueF
              felmue @Schnoble
              last edited by

              Hello @Schnoble

              clever! Maybe you could put your modified version into an Execute mpy code (eg. import)? This block can be found under System.

              Thanks
              Felix

              GPIO translation table M5Stack / M5Core2
              Information about various M5Stack products.
              Code examples

              1 Reply Last reply Reply Quote 0
              • First post
                Last post