From c8a61175a2c76e06337448863f4c81990797a2ca Mon Sep 17 00:00:00 2001 From: Craig Richardson Date: Mon, 14 May 2018 22:27:17 +0100 Subject: [PATCH] Fix PEP8 compliance --- Introducing_Gemma_M0/Gemma_UART.py | 2 +- Larson_Scanner_Shades/Larson_Scanner_Shades.py | 2 +- NeoPixie_Dust_Bag/NeoPixie_Dust_Bag.py | 2 +- PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython/main.py | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Introducing_Gemma_M0/Gemma_UART.py b/Introducing_Gemma_M0/Gemma_UART.py index b5112051a..64be6153a 100644 --- a/Introducing_Gemma_M0/Gemma_UART.py +++ b/Introducing_Gemma_M0/Gemma_UART.py @@ -13,7 +13,7 @@ while True: data = uart.read(32) # read up to 32 bytes # print(data) # this is a bytearray type - if data != None: + if data is not None: led.value = True # convert bytearray to string diff --git a/Larson_Scanner_Shades/Larson_Scanner_Shades.py b/Larson_Scanner_Shades/Larson_Scanner_Shades.py index d55638c5d..b579cc84a 100644 --- a/Larson_Scanner_Shades/Larson_Scanner_Shades.py +++ b/Larson_Scanner_Shades/Larson_Scanner_Shades.py @@ -4,7 +4,7 @@ import board import neopixel numpix = 22 # Number of NeoPixels -pixpin = board.D1 # Pin where NeoPixels are connected Gemma M0 = D1 | Trinket M0 = D4 +pixpin = board.D1 # NeoPixels pin. For Gemma M0 = D1, Trinket M0 = D4 strip = neopixel.NeoPixel(pixpin, numpix, brightness=1, auto_write=False) pos = 0 # position direction = 1 # direction of "eye" diff --git a/NeoPixie_Dust_Bag/NeoPixie_Dust_Bag.py b/NeoPixie_Dust_Bag/NeoPixie_Dust_Bag.py index bc208c360..cf704130b 100644 --- a/NeoPixie_Dust_Bag/NeoPixie_Dust_Bag.py +++ b/NeoPixie_Dust_Bag/NeoPixie_Dust_Bag.py @@ -13,7 +13,7 @@ except ImportError: import random neo_pin = board.D0 # DIGITAL IO pin for NeoPixel OUTPUT from GEMMA -touch_pin = board.D2 # DIGITAL IO pin for momentary touch sensor INPUT to GEMMA +touch_pin = board.D2 # DIGITAL IO pin for momentary touch sensor to GEMMA pixel_count = 30 # Number of NeoPixels connected to GEMMA delay_sec = .010 # delay between blinks, smaller numbers are faster delay_mult = 8 # Randomization multiplier, delay speed of the effect diff --git a/PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython/main.py b/PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython/main.py index 2eac70bc9..51ed7d164 100644 --- a/PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython/main.py +++ b/PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython/main.py @@ -41,7 +41,9 @@ while True: frame = struct.unpack(">HHHHHHHHHHHHHH", bytes(buffer[4:])) - pm10_standard, pm25_standard, pm100_standard, pm10_env, pm25_env, pm100_env, particles_03um, particles_05um, particles_10um, particles_25um, particles_50um, particles_100um, skip, checksum = frame + pm10_standard, pm25_standard, pm100_standard, pm10_env, \ + pm25_env, pm100_env, particles_03um, particles_05um, particles_10um, \ + particles_25um, particles_50um, particles_100um, skip, checksum = frame check = sum(buffer[0:30])