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
=== modified file 'README.rst'
--- README.rst 2015-03-31 18:50:28 +0000
+++ README.rst 2016-04-28 07:57:01 +0000
@@ -73,6 +73,24 @@
73 "13": "off",73 "13": "off",
74 "14": "off",74 "14": "off",
75 "15": "off"75 "15": "off"
76 },
77 "offsets": {
78 "0": 0,
79 "1": 0,
80 "2": 0,
81 "3": 0,
82 "4": 0,
83 "5": 0,
84 "6": 0,
85 "7": 0,
86 "8": 0,
87 "9": 0,
88 "10": 0,
89 "11": 0,
90 "12": 0,
91 "13": 0,
92 "14": 0,
93 "15": 0
76 }94 }
77 }95 }
7896
@@ -81,7 +99,8 @@
8199
82 $ curl http://127.0.0.1:8000/button/3100 $ curl http://127.0.0.1:8000/button/3
83 {101 {
84 "button_states": "off"102 "button_states": "off",
103 "offset": 0
85 }104 }
86105
87To set the state of a button, send a POST request with the desired state set, like so::106To set the state of a button, send a POST request with the desired state set, like so::
@@ -89,6 +108,7 @@
89 $ curl --data state=on http://127.0.0.1:8000/button/3108 $ curl --data state=on http://127.0.0.1:8000/button/3
90 {109 {
91 "button_states": "on"110 "button_states": "on"
111 "offset": 0
92 }112 }
93113
94..the service returns the new state of the button.114..the service returns the new state of the button.
@@ -112,6 +132,44 @@
112132
113 $ curl --data state=off http://127.0.0.1:8000/button/0133 $ curl --data state=off http://127.0.0.1:8000/button/0
114134
135Setting offsets
136===============
137The default rotation of the servo, along with proper calibration, should
138push the button on the device in most cases. However, if adjustments are
139needed, they can be set for each port separately.::
140
141 $ curl localhost:8000/button/3 --data offset=-10
142
143A negative offset will cause the servo to rotate more, in order to push the
144button - effectively pushing it harder. A positive offset will cause the
145servo to rotate less in order to push the button. For reference, the default
146"off" position is at 300, and the default "pressed" position is 193.
147
148The environment variable UCI_PHONE_MASHER_CONFIG may be used to specify the
149path to a json config file for the offsets. It should be formatted like this::
150
151 {
152 "0": 0,
153 "1": 0,
154 "2": 0,
155 "3": 0,
156 "4": 0,
157 "5": 0,
158 "6": 0,
159 "7": 0,
160 "8": 0,
161 "9": 0,
162 "10": 0,
163 "11": 0,
164 "12": 0,
165 "13": 0,
166 "14": 0,
167 "15": 0
168 }
169
170If the config file is specified in the environment, then any modifications to
171offsets will automatically be saved to the same file
172
115Creating a Bootable Image for Raspberry PI 2173Creating a Bootable Image for Raspberry PI 2
116============================================174============================================
117175

Subscribers

People subscribed via source and target branches