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

Using CFFI with c_environment #7

Open
sheepcloner opened this issue Jan 26, 2015 · 0 comments
Open

Using CFFI with c_environment #7

sheepcloner opened this issue Jan 26, 2015 · 0 comments

Comments

@sheepcloner
Copy link

The python lib provided for pcduino with gpio lacks quite a bit. In particular I am interested in in pulseIn function, which is not available. I tried to write my own, but I get strange behavior (this is for HC-SR04 distance sensor).
I see that another issue was closed asking people to use CFFI. It is not clear to me how to use it, so I tried the following and failed with ugly compile errors:

from cffi import FFI
ffi = FFI()
lib = ffi.verify("#include <~/c_enviroment/sample/core.h>")

as you can see I did not get far ( I am sure I am doing something totally wrong). I get this error:

File "/usr/local/lib/python2.7/dist-packages/cffi/ffiplatform.py", line 51, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.ffiplatform.VerificationError: CompileError: command 'gcc' failed with exit status 1

I have also tried:

ffi.verify("#include \"/home/ubuntu/c_enviroment/sample/core.h\"")

This time it will find core.h, but complain that it can not find all the other .h files like Arduino.h that core.h refers too.

I would appreciate your help. Thank you

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

1 participant