2021-06-01, 01:32 PM
(This post was last modified: 2021-06-01, 09:05 PM by Kris.
Edit Reason: I gave it more thought but that did not seem to have solved the problem... yet
)
Quote:It is normal for the switch to short at end of travel. You should short the pin to gnd so it goes low when the switch is closed and the internal pullup keeps it high when open. i'm not sure how you wired it, but I don't think you want to change the code since there are not internal pulldowns, or at least you are complicating the design with external resistors.
Unless you mean your switch is normally closed and only opens at end of travel??
Sorry for taking up your time on this while I did not remember all the details right. I made a big switch box in order to be able to switch back to the good old trusty Neco control box for redundancy reasons. The switch box is already quite big and complicated. It switches the power, the main coil, the shunt coil and serial coil, the clutch coil, the end of travel switches and the rudder angle back and forth between the PyPilot and the Neco control box. I could not easily change to where and when the end of travel switches short to while keeping the Neco control box operational as well. Changing the code was easier than more wiring. Now that I started 3d printing everything, I will make a new separate rudder position sensor as well as separate end switches for the Pypilot, and keep the old end switches and rudder position sensor wired permanently to the Neco control box. It will be great for redundancy and simplicity of the switch box, and I will get to keep your original code.
Quote:You have to run "sudo python3 setup.py install" twice
Running this in the terminal gives me: "python3: can't open file 'setup.py': [Errno 2] No such file or directory"
I also tried typing "sudo apt-get install python3"
It gives me this:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version (3.7.3-1).
0 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.
I then tried to upgrade to python 3.9.5. following instruction here: https://itheo.nl/install-python-3-9-on-raspberry-pi
When I get to: "sudo update-alternatives --config python"
It says: "update-alternatives: error: no alternatives for python"
Then I follow the troubleshooting part and: nano ~/.bashrc
But there is nothing that looks like "alias python=/usr/bin/python-3.8" in the file.
I think I am thrown a bit off course, or am I not? I am a newbie to the Linux ecosystem.