summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-10-31 16:36:25 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-10-31 16:36:25 +0300
commitf5dde543a1832bc24e4bc117a769549e5aadd784 (patch)
treebb91aca6d77bba7524456d0f94a5d0f419b4a28f
parentfe32256e0d009b3defe96da256c8cf96bcb9e188 (diff)
simplify code a bit
-rwxr-xr-xexample.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/example.py b/example.py
index 3ebfc6c..cb12a9f 100755
--- a/example.py
+++ b/example.py
@@ -3,7 +3,7 @@ import os, logging
from argparse import ArgumentParser
from mg996r import MG996R
-default_degree = 360
+start_degree = 360
state_file = '.servo-state'
if __name__ == '__main__':
@@ -16,11 +16,9 @@ if __name__ == '__main__':
parser.add_argument('--pin', type=str, default='PA6',
help='GPIO pin to use')
parser.add_argument('--reset', action='store_true',
- help=f'Use clean default state (degree = {default_degree})')
+ help=f'Use clean default state (degree = {start_degree})')
args = parser.parse_args()
- start_degree = default_degree
-
# restore previous degree from a file
if not args.reset:
try: