Articles Hierarchy

Articles Home » RPI » RPI operates ARDUINO PID control

RPI operates ARDUINO PID control

you have a arduino but no raspberry PI, no problem,
the trend i made already on a PC in python
( what formerly was installed for the PMS3 tool )
so now i try to make this tool also available for PC.
And i try it with the laptop without PYTHON, so here the full installation.
( even there is a windows 7 64bit version running following works: )

from get
python 2.7.8 for windows
doubleclick python-2.7.8.msi
it not make a desktop icon, pls find START / all programs /Python 2.7/ IDLE / for start
get pyserial-2.7.win32.exe run

find file / open / Scripts :miniterm and start, give in COMxx for your connected arduino

in open PYTHON shell type
import _tkinter and get >>> now i know its included already

get numpy-1.8.1-win32-superpack-python2.7.exe run

get matplotlib-1.3.1.win32-py2.7.exe run

from get
python-dateutil-2.2.win32-py2.7.exe run
pyparsing-2.0.2.win32-py2.7.exe run
six-1.7.3.win32-py2.7.exe run

now get the project:
get (RPI version )

now, even our PYTHON for WINDOWS is ready,
some things have to be changed in the code:

i created a working directory for the ( copy of ) the 2 python files
and a C:/Temp/ directory ( instead of ramdisk )
RAMDISKpath = 'C:/temp/' # for WIN PC
#RAMDISKpath = '/run/shm/'

initfilepath= RAMDISKpath # for WIN PC
#initfilepath= '/home/pi/arduinoproject/'
and copy toarduino_init.csv also to that
( with content like RSP setpoint 50% :)

# sport = "/dev/ttyACM0"
sport = "COM14" # failed PORT already open #not need, and error in win 7
RAMDISKpath = 'C:/temp/' # for WIN PC
#RAMDISKpath = '/run/shm/'

GIF_filepath = 'X:/xxx'

for test ( if service not run ) copy
fromarduino.csv to C:/temp/ ( with content like :)

the service you start after testing
with RUN ( command prompt window with all full path information or just with double click on the file )
C:\Users\me: C:/xxx/python.exe E:/yyy/
check in C:/Temp/ for the update of the files
to stop the service type CTRL C in the command prompt window

the operation can start from python command line or python IDLE interface

in the new version these variable adjust to the operating system, still you need to preset them.

in a later version i also needed python PIL ( for *.jpg..):
from Python Imaging Library 1.1.7 for Python 2.7
get PIL-1.1.7.win32-py2.7.exe run