grzesiek2115
Posts: 2
Joined: Wed Sep 18, 2019 12:52 pm

SPI on Raspberry Pi. "Translating" from C to python.

Wed Sep 18, 2019 1:02 pm

Hi, I'm new and I'm a beginner in programming.I would like to "translate" that code https://wklejaj.pl/kod_w_c from C to Python. Actually, I've found documentation for spidev library for python http://tightdev.net/SpiDev_Doc.pdf but I can't fin something similar for spidev library for C.

I have problems especially with functions calles spiOpen, spiTransfer, spiClose.

Is anyone here who can help me to do this or give some advices? I couldn't find anything in Google which may have sense.

thanks a lot

RattusRattus
Posts: 70
Joined: Sat Sep 29, 2018 11:27 am

Re: SPI on Raspberry Pi. "Translating" from C to python.

Wed Sep 18, 2019 6:27 pm

I would statrt with a turorial like https://learn.sparkfun.com/tutorials/ra ... torial/all
in in particular take a close look at SPIdev https://pypi.org/project/spidev/

Hope this helps

/Andy

grzesiek2115
Posts: 2
Joined: Wed Sep 18, 2019 12:52 pm

Re: SPI on Raspberry Pi. "Translating" from C to python.

Sat Oct 05, 2019 5:08 pm

Sorry that I'm repling so late. Actually I've found manuals how to install spidev on my RPi.

http://tightdev.net/SpiDev_Doc.pdf
If I follow this instruction and typing in a command "sudo apt-get install python-dev" my RPi replies with p"Package python-dev has no installation candidate". I was looking for some solution in Google but nothing works.

What I want to do is install spidev for python 3.5.3. (version of python matters) but I stuck with it for a few days with no solution.

Any help needed.
Thank You

Return to “Beginners”