Reputation: 95
Hi I am trying to follow the tutorial here and (use pyfirmata to control Arduino IDE) and it is displaying the error message in title when I run python3 ./firmata.py
https://realpython.com/arduino-python/#the-arduino-platform
I downloaded pyfirmata using "pip3 install pyfirmata"
when I checked the python packages list in terminal I found it though:
code below (if helps)
import pyfirmata
import time
board = pyfirmata.Arduino('/dev/ttyACM0')
while True:
board.digital[13].write(1)
time.sleep(1)
board.digital[13].write(0)
time.sleep(1)
output when runs python3 now: C:\Users\Abdulrahman\AppData\Local\Microsoft\WindowsApps\python3.exe: can't open file 'C:\Users\Abdulrahman\firma.py': [Errno 2] No such file or directory
Hope I was clear enough. Thank you in advance!
Upvotes: -1
Views: 237
Reputation: 336
If you're using VS code try to do CTRL + SHIFT + P, type settings.json and add this to json file:
{
"python.defaultInterpreterPath": "C:/Users/your_username/AppData/Local/Programs/Python/Python312/python.exe"
}
In the example above I inserted python 3.12 as the interpreter version. Adjust it to your actual version of python installed in your computer.
After doing that restart VS code then uninstall and reinstall the pyfirmata package
Upvotes: 1