Merge pull request #291 from dastels/master

Switch log control to a global constant
This commit is contained in:
Mike Barela 2018-08-08 15:55:13 -04:00 committed by GitHub
commit bb21868b95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 14 deletions

View file

@ -5,6 +5,9 @@ import pulseio
import adafruit_irremote
import adafruit_lis3dh
# Control debug output: it takes time so don't unless you're debugging
DEBUG_LOG = False
# Control codes
STOP = 0x01
ROTATE_LEFT = 0x02
@ -32,17 +35,12 @@ encoder = adafruit_irremote.GenericTransmit(header=[9500, 4500],
zero=[550, 1700],
trail=0)
# pylint: disable=unused-argument
# pylint: disable=pointless-statement
def log(s):
"""Optionally output some text.
:param string s: test to output
"""
# swap the comments on the next two lines to enable/disable logging output
pass
# print(s)
# pylint: enable=pointless-statement
# pylint: enable=unused-argument
if DEBUG_LOG:
print(s)
while True:

View file

@ -3,6 +3,9 @@ import pulseio
import adafruit_irremote
from adafruit_crickit import crickit
# Control debug output: it takes time so don't unless you're debugging
DEBUG_LOG = False
# Control codes
STOP = 0x01
ROTATE_LEFT = 0x02
@ -18,17 +21,12 @@ left_wheel = crickit.dc_motor_1
right_wheel = crickit.dc_motor_2
# pylint: disable=unused-argument
# pylint: disable=pointless-statement
def log(s):
"""Optionally output some text.
:param string s: test to output
"""
# swap the comments on the next two lines to enable/disable logging output
pass
# print(s)
# pylint: enable=pointless-statement
# pylint: enable=unused-argument
if DEBUG_LOG:
print(s)
# These allow easy correction for motor speed variation.