shiftpi icon indicating copy to clipboard operation
shiftpi copied to clipboard

pinsSetup() typeError

Open thompcd opened this issue 9 years ago • 2 comments

I am having an issue attempting to change the default SER, RCLK & SRCLK pins. I changed the value of the aforementioned pins within the shiftpi.py file as follows. Simple enough.

# Define pins _SER_pin = 24 #pin 14 on the 75HC595 _RCLK_pin = 23 #pin 12 on the 75HC595 _SRCLK_pin = 22 #pin 11 on the 75HC595

And then I call the pinsSetup() function in my program with the format used in the readme, as follow:

import shiftpi.shiftpi as shiftpi . (other code) . shiftpi.pinsSetup({"ser": shiftpi._SER_pin, "rclk": shiftpi._RCLK_pin, "srclk": shiftpi._SRCLK_pin}) # that's it!

After that, I receive the following output:

Traceback (most recent call last): File "modbusTest2.py", line 23, in <module> shiftpi.pinsSetup({"ser": shiftpi._SER_pin, "rclk": shiftpi._RCLK_pin, "srclk": shiftpi._SRCLK_pin}) # that's it! TypeError: pinsSetup() takes exactly 0 arguments (1 given)

I'm brand new to python, so I'm having some trouble figuring this one out. If anybody could offer advice as to whether I'm approaching this the wrong way or to just let me know that this is a bug, it would be much appreciated. I can't find an example of anybody using this function(?), so I'm not sure if there is any easier way to do it that I'm just oblivious to or what. Also, not sure if it matters, but I am using Python 2.7 and running with sudo.

Any input is appreciated. Thanks!

thompcd avatar Jul 15 '16 20:07 thompcd

First of all, thanks a lot for this library. It's helping me. But I'm having a similar Problem. When I use shiftpi.pinsSetup({"ser": 11, "rclk": 12, "srclk": 13}) to set the Pins, I also get an TypeError: pinsSetup() takes exactly 0 arguments (1 given) Error Message.

please advise.

PhilipKyleBoone avatar Jun 04 '17 19:06 PhilipKyleBoone

shiftpi.pinsSetup(**{"ser": 11, "rclk": 12, "srclk": 13}) seems to work ok

dogproblems avatar Apr 07 '18 17:04 dogproblems