Comments (5)
Here's dmesg from a run of the breaking script
1 [ 268.944775] sb-pwm: pwm_disable 1
2 [ 268.944817] sb-pwm: set_pwm_gpio_level ret=0
3 [ 268.945281] sb-pwm: pwm_config duty=7, period=2000
4 [ 268.945292] sb-pwm: pwm_config 1
5 [ 268.945302] sb-pwm: pre_scal:120, entire_cycle:256, pwm_freq:781
6 [ 268.945310] sb-pwm: ----781
7 [ 268.945317] sb-pwm: pre_scal:180, entire_cycle:256, pwm_freq:520
8 [ 268.945325] sb-pwm: ----520
9 [ 268.945332] sb-pwm: pre_scal_id=1, active_cycle=1
10 [ 268.945341] sb-pwm: pwm_enable 1
11 [ 268.945745] sb-pwm: pwm_config duty=15, period=2000
12 [ 268.945755] sb-pwm: pwm_config 1
13 [ 268.945764] sb-pwm: pre_scal:120, entire_cycle:256, pwm_freq:781
14 [ 268.945772] sb-pwm: ----781
15 [ 268.945779] sb-pwm: pre_scal:180, entire_cycle:256, pwm_freq:520
16 [ 268.945787] sb-pwm: ----520
17 [ 268.945794] sb-pwm: pre_scal_id=1, active_cycle=2
18 [ 268.945802] sb-pwm: pwm_enable 1
19 [ 268.946193] sb-pwm: pwm_disable 1
20 [ 268.946213] sb-pwm: set_pwm_gpio_level ret=0
21 [ 268.957074] sb-pwm: pwm_config duty=7, period=2000
22 [ 268.957089] sb-pwm: pwm_config 1
23 [ 268.957098] sb-pwm: pre_scal:120, entire_cycle:256, pwm_freq:781
24 [ 268.957106] sb-pwm: ----781
25 [ 268.957113] sb-pwm: pre_scal:180, entire_cycle:256, pwm_freq:520
26 [ 268.957121] sb-pwm: ----520
27 [ 268.957128] sb-pwm: pre_scal_id=1, active_cycle=1
28 [ 268.957137] sb-pwm: pwm_enable 1
29 [ 268.967971] sb-pwm: pwm_config duty=15, period=2000
30 [ 268.967985] sb-pwm: pwm_config 1
31 [ 268.967994] sb-pwm: pre_scal:120, entire_cycle:256, pwm_freq:781
32 [ 268.968002] sb-pwm: ----781
33 [ 268.968009] sb-pwm: pre_scal:180, entire_cycle:256, pwm_freq:520
34 [ 268.968017] sb-pwm: ----520
35 [ 268.968025] sb-pwm: pre_scal_id=1, active_cycle=2
36 [ 268.968033] sb-pwm: pwm_enable 1
37 [ 268.978778] sb-pwm: pwm_config duty=23, period=2000
38 [ 268.978792] sb-pwm: pwm_config 1
39 [ 268.978802] sb-pwm: pre_scal:120, entire_cycle:256, pwm_freq:781
40 [ 268.978810] sb-pwm: ----781
41 [ 268.978817] sb-pwm: pre_scal:180, entire_cycle:256, pwm_freq:520
42 [ 268.978826] sb-pwm: ----520
43 [ 268.978833] sb-pwm: pre_scal_id=1, active_cycle=3
44 [ 268.978841] sb-pwm: pwm_enable 1
45 [ 268.989513] sb-pwm: pwm_config duty=31, period=2000
46 [ 268.989525] sb-pwm: pwm_config 1
47 [ 268.989534] sb-pwm: pre_scal:120, entire_cycle:256, pwm_freq:781
48 [ 268.989542] sb-pwm: ----781
49 [ 268.989549] sb-pwm: pre_scal:180, entire_cycle:256, pwm_freq:520
50 [ 268.989557] sb-pwm: ----520
and the actual script
import time
from pcduino import pwm
if __name__ == '__main__':
pin = 2
for i in xrange(3):
pwm.analog_write(pin, i)
for i in xrange(4):
pwm.analog_write(pin, i)
time.sleep(0.01)
pwm.analog_write(pin, 0)
from python-pcduino.
This script will reliably reproduce the issue
from pcduino import pwm
if __name__ == '__main__':
for i in xrange(256):
pwm.analog_write(1, i)
I can also reproduce the issue in bash
for i in $(seq 0 255); do
echo -n $i > /sys/class/leds/pwm1/brightness;
done
The upper binary value seems to be the second value written in rapid succession. i.e. the upper value in this example appeared to be "1".
from python-pcduino.
Just pinged @linksprite. Will report back.
from python-pcduino.
Heard from the developers that this issue should be fixed in the latest pcduino image.
from python-pcduino.
The following error occurred while I was editing my project: No such file or directory :/sys/class/misc/pwmtimer/enable
from python-pcduino.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-pcduino.