We just built pi dog with my son and are having a blast with the preset python projects (like ball tracking) but we are confused on how to initiate and write custom code in the next section of “easy coding” what is the prompt from the post ssh log in screen to initiate these custom actions, is a virtual environment required? Also how do you stop one script from being carried out and and start a new one in the same powershell, so far I’ve just closed powershell and re logged into my pi for a new script action? Thanks and my son and I are new at this very eager to learn coding.
Hi
Im not sure to have fully understood your question. However, the easy coding contains example code snippets that you can just copy into new python files.
E.g create a new file with some editor e.g
nano MyNewFile.py
and then copy and paste any of the sample code into that file… e.,g
#import Pidog class
from pidog import Pidog
my_dog = Pidog(leg_init_angles = [25, 25, -25, -25, 70, -45, -70, 45],
head_init_angles = [0, 0, -25],
tail_init_angle= [0]
)
Then run the file with the same command syntax used to run the examples
python3 MyNewFile.py
To stop a program cleanly, most just require to press ctrl-c
venv is not normally required. One notable exception being pidog chatgpt
If I am ssh into the raspberry pi how do I use the nano editor to create a new .py file?