Giter Site home page Giter Site logo

python-pcduino's People

Contributors

johannesack avatar linksprite avatar mwhooker avatar yaoq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-pcduino's Issues

Using CFFI with c_environment

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

eeror

The following error occurred while I was editing my project: No such file or directory :/sys/class/misc/pwmtimer/enable

pwm pins exhibit bimodal behavior

Edit: see below for how to reproduce

Sometimes a PWM pin will get in to a mode where values
0: off
1:
2: <same as 1>

i.e. setting a value >= 1 will cause it to emit at a certain frequency (I've seen low values and high values), but no value > 1 will change it.

The actual value written can still be read.

Rebooting the device fixes the issue.

rewrite to use cffi

Let's use cffi to talk to the c library files instead of duplicating functionality in python.

Would solve #5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.