ash73
Posts: 11
Joined: Mon Jan 30, 2017 12:52 pm

controlling Arduino from Pi

Sun Feb 05, 2017 4:40 pm

Hi, new to Python and I want to control Arduino pins via my Pi2. I was about to embark on writing some serial comms but found nanpy. It works ok in Python 2 but not in Python 3, and of course I'm using Python 3. Also tried PyFirmata but same problem.

I want to read and write the digital pins (0-13), read and write the PWM pins (3,5,6,9,10,11) and read the analog pins (A0-A5).

When I try nanpy in Python 3 it says:

>>> from nanpy import ArduinoApi
Traceback (most recent call last):
File "<pyshell#0>", line 1, in
from nanpy import ArduinoApi
ImportError: cannot import name 'ArduinoApi'

Most likely a noob error, any suggestions? TIA.

ash73
Posts: 11
Joined: Mon Jan 30, 2017 12:52 pm

Re: controlling Arduino from Pi

Mon Feb 06, 2017 10:45 am

Nevermind got it working, just needed to use pip3 rather than pip to install it for Python 3 :)

Very impressed with nanpy, works well.

Return to “Python”