Merge lp:~pwlars/uci-phone-masher/offset-readme into lp:uci-phone-masher

Proposed by Paul Larson
Status: Merged
Merged at revision: 15
Proposed branch: lp:~pwlars/uci-phone-masher/offset-readme
Merge into: lp:uci-phone-masher
Diff against target: 90 lines (+59/-1)
1 file modified
README.rst (+59/-1)
To merge this branch: bzr merge lp:~pwlars/uci-phone-masher/offset-readme
Reviewer Review Type Date Requested Status
Canonical Hardware Certification Pending
Review via email: mp+293203@code.launchpad.net

Description of the change

Readme for the new offset support in uci-phone-masher

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.rst'
2--- README.rst 2015-03-31 18:50:28 +0000
3+++ README.rst 2016-04-28 07:57:01 +0000
4@@ -73,6 +73,24 @@
5 "13": "off",
6 "14": "off",
7 "15": "off"
8+ },
9+ "offsets": {
10+ "0": 0,
11+ "1": 0,
12+ "2": 0,
13+ "3": 0,
14+ "4": 0,
15+ "5": 0,
16+ "6": 0,
17+ "7": 0,
18+ "8": 0,
19+ "9": 0,
20+ "10": 0,
21+ "11": 0,
22+ "12": 0,
23+ "13": 0,
24+ "14": 0,
25+ "15": 0
26 }
27 }
28
29@@ -81,7 +99,8 @@
30
31 $ curl http://127.0.0.1:8000/button/3
32 {
33- "button_states": "off"
34+ "button_states": "off",
35+ "offset": 0
36 }
37
38 To set the state of a button, send a POST request with the desired state set, like so::
39@@ -89,6 +108,7 @@
40 $ curl --data state=on http://127.0.0.1:8000/button/3
41 {
42 "button_states": "on"
43+ "offset": 0
44 }
45
46 ..the service returns the new state of the button.
47@@ -112,6 +132,44 @@
48
49 $ curl --data state=off http://127.0.0.1:8000/button/0
50
51+Setting offsets
52+===============
53+The default rotation of the servo, along with proper calibration, should
54+push the button on the device in most cases. However, if adjustments are
55+needed, they can be set for each port separately.::
56+
57+ $ curl localhost:8000/button/3 --data offset=-10
58+
59+A negative offset will cause the servo to rotate more, in order to push the
60+button - effectively pushing it harder. A positive offset will cause the
61+servo to rotate less in order to push the button. For reference, the default
62+"off" position is at 300, and the default "pressed" position is 193.
63+
64+The environment variable UCI_PHONE_MASHER_CONFIG may be used to specify the
65+path to a json config file for the offsets. It should be formatted like this::
66+
67+ {
68+ "0": 0,
69+ "1": 0,
70+ "2": 0,
71+ "3": 0,
72+ "4": 0,
73+ "5": 0,
74+ "6": 0,
75+ "7": 0,
76+ "8": 0,
77+ "9": 0,
78+ "10": 0,
79+ "11": 0,
80+ "12": 0,
81+ "13": 0,
82+ "14": 0,
83+ "15": 0
84+ }
85+
86+If the config file is specified in the environment, then any modifications to
87+offsets will automatically be saved to the same file
88+
89 Creating a Bootable Image for Raspberry PI 2
90 ============================================
91

Subscribers

People subscribed via source and target branches