Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile the examples in C #2

Open
mabiven opened this issue Dec 31, 2024 · 4 comments
Open

Compile the examples in C #2

mabiven opened this issue Dec 31, 2024 · 4 comments

Comments

@mabiven
Copy link

mabiven commented Dec 31, 2024

Hello,

I'd like to compile and run the programs in C.
I have an error with the "spi.h" include.

$ gcc real_time.c -o real_time
real_time.c:4:10: fatal error: spi.h: Aucun fichier ou dossier de ce type
#include "spi.h"
^~~~~~~

Can you help me with this problem?
Thank you
Marc

@Ildaron
Copy link
Member

Ildaron commented Jan 1, 2025

Hi @mabiven generally I didn't use a long time this library and stopped supporting it because a many problem with compilation, but I'll try to figure it out after the holidays

@marc-abiven
Copy link

I successfully compiled the program 1.Read_data.c with the following command:

gcc -I ~/c-periphery/src ~/c-periphery/src/gpio_sysfs.c ~/c-periphery/src/spi.c ~/c-periphery/src/gpio.c 1.Read_data.c

When running, I have the error:

spi_open_error_ADS1299 dont send dataADS1299 dont send dataADS1299 dont send dataADS1299...

Does the script run on your side?

Cheers,

Marc

@Ildaron
Copy link
Member

Ildaron commented Jan 22, 2025

Hi @marc-abiven I used 4 years ago last time,

Generally, just python scripts is works, to confirm that everything is ok ?

Did you turn SPI in the Jetson Nano?

@marc-abiven
Copy link

marc-abiven commented Jan 22, 2025

The python script (1.Graph_real_time.py) works.
I enabled SPI1 and SPI2 with sudo python /opt/nvidia/jetson-io/jetson-io.py.
spidev is also loaded with modprobe spidev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants