Hello! Could you help a new guy?

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Tutorus
 
Posts: 6
Joined: Sun Nov 03, 2019 9:41 pm

Hello! Could you help a new guy?

Post by Tutorus »

Hello,
I need help. I'm building a robot project with Raspberry pi 3 with a python program called lightSeeker.py This program requires to import a file called Adafruit_GPIO.SPI. The python command in the program is: import Adafruit_GPIO.SPI as SPI
How can I get such file. Any help would be greatly appreciated.
Sincerely,
Victor

User avatar
V2man
 
Posts: 704
Joined: Mon Dec 03, 2018 12:38 am

Re: Hello! Could you help a new guy?

Post by V2man »

I don't know which install I did to get Adafruit_GPIO but I know I have it installed on my RPI.
In REPL window of python editor on RPI
import Adafruit_GPIO.SPI as SPI
dir(SPI)
Out[11]:
['BitBang',
'GPIO',
'LSBFIRST',
'MSBFIRST',
'SpiDev',
'SpiDevMraa',
'__builtins__',
'__cached__',
'__doc__',
'__file__',
'__loader__',
'__name__',
'__package__',
'__spec__',
'operator',
'time']

Did you ever do a pip3 install RPI.GPIO adafruit-blinka in a Terminal window on RPI?

Adafruit_GPIO directory is located here /home/pi/.local/lib/python3.7/site-packages.

This what I get when do python3 -m pip show adafruit-blinka
Name: Adafruit-Blinka
Version: 2.6.1
Summary: CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.
Home-page: https://github.com/adafruit/Adafruit_Blinka
Author: Adafruit Industries
Author-email: [email protected]
License: MIT
Location: /home/pi/.local/lib/python3.7/site-packages
Requires: spidev, rpi-ws281x, RPi.GPIO, Adafruit-PlatformDetect, Adafruit-PureIO, sysv-ipc
Required-by: adafruit-circuitpython-seesaw, adafruit-circuitpython-motor, adafruit-circuitpython-crickit, adafruit-circuitpython-busdevice, adafruit-circuitpython-neopixel

python3 -m pip show spidev
Name: spidev
Version: 3.4
Summary: Python bindings for Linux SPI access through spidev
Home-page: http://github.com/doceme/py-spidev
Author: Volker Thoms
Author-email: [email protected]
License: GPLv2
Location: /usr/local/lib/python3.7/dist-packages
Requires:
Required-by: Adafruit-GPIO, Adafruit-Blinka, unicornhathd

User avatar
mikeysklar
 
Posts: 14168
Joined: Mon Aug 01, 2016 8:10 pm

Re: Hello! Could you help a new guy?

Post by mikeysklar »

Hi Tutorus,

I am curious which project of ours you are trying to get running (please provide a link). We primarily use busio.SPI with our CircuitPython projects on the Raspberry Pi.

https://learn.adafruit.com/circuitpytho ... rs-devices

User avatar
V2man
 
Posts: 704
Joined: Mon Dec 03, 2018 12:38 am

Re: Hello! Could you help a new guy?

Post by V2man »

@ mikeysklar I think @Tutorus is trying to run lightseeker.py from https://github.com/Apress/beg-artificia ... tSeeker.py

User avatar
mikeysklar
 
Posts: 14168
Joined: Mon Aug 01, 2016 8:10 pm

Re: Hello! Could you help a new guy?

Post by mikeysklar »

V2man - Thank you for the link.

Our Adafruit_Python_GPIO library is deprecated at this point. We currently support Adafruit Blinka (busio / SPI).
DEPRECATED! Please use Adafruit Blinka instead (was: Library to provide a cross-platform GPIO interface on the Raspberry Pi and Beaglebone Black using the RPi.GPIO and Adafruit_BBIO libraries.)
https://github.com/adafruit/Adafruit_Python_GPIO

User avatar
Tutorus
 
Posts: 6
Joined: Sun Nov 03, 2019 9:41 pm

Re: Hello! Could you help a new guy?

Post by Tutorus »

Thank you all.
V2man, yes! that is exactly the book where I got this AI project. So far, two test runs haven't worked since I couldn't find or decompress in Raspbian the file that I initially found.
I'll try to use the file you are suggesting and will see what happens. I'll keep you posted.
Thank you,
Victor

Locked
Please be positive and constructive with your questions and comments.

Return to “For Educators”