From f5dde543a1832bc24e4bc117a769549e5aadd784 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sun, 31 Oct 2021 16:36:25 +0300 Subject: simplify code a bit --- example.py | 6 ++---- 1 file 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: -- cgit v1.2.3