You may get a security warning if running from the Internet browser. If the internet browser does not show the Python install program, look for the install program in the Windows Downloads folder and double-click it there. This install process will be similar for any program you download from the internet. Once downloading is complete, start the install process by double-clicking on the file name. But, ideally, you should be using version 3.x if possible. In this case, you may want to use the same version you are already using on the Raspberry Pi. If you have some experience already, then select the version, you prefer on your system. Other versions of the programming language are also available including 64 bit. The suggested version will show either by hovering the mouse pointer over or clicking on the Downloads Tab. I guess if you are new to programming then I would recommend downloading the suggested Python version (3.x, 32 bit). To begin installing the Python programming language, point your internet browser to the Python homepage here. Installing OpenCV camera vision software is optional, but since some of the projects I publish include OpenCV, I add the install guide in this feature. The above article has example code that can easily access both the Raspberry Pi Camera and a standard compatible webcam on a PC. Pi Camera Video Capture with OpenCV and Python Multithreading – Link. So it makes sense to experiment with OpenCV on the much more powerful PC before moving the final OpenCV application to the Raspberry Pi. Providing you install the same Python Modules for both Raspberry Pi and Windows, an OpenCV application can swap between two platforms easily. But instead, use special functions to keep GPIO statements confined and organised. It is probably good practice not to spread GPIO access statements across the entire program. I will use dummy data or print statements to attempt to simulate GPIO input and output where possible. I will usually debug as much code as I can on the PC before transferring to the Raspberry Pi. However, unless I need access to GPIO connected devices, I write, run and debug the code on the PC first before any FTP transfer. Therefore, I use a text editor on my Windows PC and then transfer the code file via FTP to the Raspberry Pi. I generally don’t write new code directly on the Raspberry Pi in case of unrecoverable failure of the SD Card. Additionally, I recommend the Geany text editor which I recently discovered. Therefore I go through the install process of the Python programming language, and I also include installing OpenCV. Ideally, to save the Raspberry Pi SD Card, we can debug the bulk of the Python code on our much faster laptop or PC instead.
0 Comments
Leave a Reply. |