diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2021-10-31 16:36:25 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-10-31 16:36:25 +0300 |
commit | f5dde543a1832bc24e4bc117a769549e5aadd784 (patch) | |
tree | bb91aca6d77bba7524456d0f94a5d0f419b4a28f | |
parent | fe32256e0d009b3defe96da256c8cf96bcb9e188 (diff) |
simplify code a bit
-rwxr-xr-x | example.py | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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: |