简体   繁体   中英

Python for Pi: Dealing with GPIO for Windows IDE

I have a quick question about Raspberry Pi application development. My team and I have been tasked with updating the software for a robot that is controlled by a Raspberry Pi. I have been trying to convert the single large file into more compact functions and classes. Developing this code on the Pi itself is very frustrating and time-consuming due to the limited system resources so I started using PyCharm on my multi-monitor desktop. This works very well for major changes, but I have to load the code back onto the Pi in order to run it. I tried testing it on my PC (Windows 7), but the Serial module returned an error, and the RPi.GPIO module wouldn't install on the PC ("error: Unable to find vcvarsall.bat").

I'm going to have to part with the hardware itself for a few weeks tomorrow, so any advice on getting it to work on a PC would be greatly appreciated. I don't need the packets to actually get sent anywhere, but I would like to be able to step through the code to see if the calculations and look-up tables are functioning properly. My current solution is to just paste a try-catch block over every misfunctioning line of code, but I would really like to find a more elegant solution if there is one. Thanks!

go here and get the pro version for free (since you are a student) https://www.jetbrains.com/student/

then find the ip address of your pi if you dont already know it

then set up your project to automatically sync

Tools > Deployment > Configuration

click + to add a new configuration

enter your pi's IP address and user credentials

then click the mapping tab and set up one or more folder mappings

then go to File > Settings

then go to Project : My Project Name > interpretter and click the gear and click add remote and select your deployment server ... now you can run and debug in pycharm remotely

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM