Hi there,
I was wondering how I would make it so that when I turn on my rpi it would run my python file?
I am using 2 motors to open a hatch and I was wondering how I would code in python3 to make a default position so that when the program is ran the motor resets to the default position?
I may be wording it weird but what I am trying to prevent is the door being open 100% and say i lost power and when it turned back on it would think the door is at 0% open and try to open it all the way again.
Tacoon:
when I turn on my rpi it would run my python file
This Forum is for programming Arduinos, not Raspberry Pis.
...R
My arduino is connected to a raspberry pi...
You need either an absolute encoder or limit switches on the motor or door.
If using limit switches, upon startup, run the motor until the switch activates. Then you know where the door is.
Tacoon:
My arduino is connected to a raspberry pi...
Perhaps - but your question is about RPi programming.
If you have a problem with an Arduino program please post the code, tell us what the problem is, and we will try to help.
...R