What we're going to do is essentially send data from our Arduino for our Python code to process, so let's first get our Arduino to send some data. Let's get our Arduino sending some output. Now that we've gotten all of the annoying steps out of the way, let's get to the fun parts! For the sake of getting you up and running, I'll keep this short and concise. If this works, you're awesome and you should awesome, but if not, this guide should help. If you're lucky enough, you should just be able to download it, extract it, open Terminal, cd into the folder and run python setup.py install, just as you did before. download the library from source forge: 2. I have included a guide for you to follow, but I recommend you have MySQL, python, and XCode(or the latest GCC) installed before you try and install MySQLdb. I just want to note, this step can be very annoying, but very rewarding once completed. (screen shot below) Next, we will install the library to allow Python to talk with MySQL called MySQLdb. Open terminal and cd into the extracted folder and run the following command: python setup.py install This will install the pySerial package.
Arduino serial library execute script for mac#
For mac or linux users, download the file and extract it. You can download the pySerial library here: 2. you can kind of think of it as a stream connecting the Arduino code to the Python code (insert other silly analogies here). Simply put, the pySerial library allows your Python script to talk with the serial port in which the Arduino is connected. First you'll need to install the pySerial library. First I'll point you in the right direction for installing the required Python libraries.