Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pinsSetup() typeError #10

Open
thompcd opened this issue Jul 15, 2016 · 2 comments
Open

pinsSetup() typeError #10

thompcd opened this issue Jul 15, 2016 · 2 comments

Comments

@thompcd
Copy link

thompcd commented Jul 15, 2016

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!

@PhilipKyleBoone
Copy link

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.

@dogproblems
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants