Autformat the rest
MODIFY
Morse_Code_Flasher/main.py
Morse_Code_Flasher/main.py
# License: MIT License (https://opensource.org/licenses/MIT)
import time
+
import board
import neopixel
@@ -19,14 +20,50 @@ symbol_gap = dot_length # Duration of gap between dot or dash
character_gap = (dot_length * 3.0) # Duration of gap between characters
flash_color = (255, 0, 0) # Color of the morse display.
brightness = 0.5 # Display brightness (0.0 - 1.0)
-morse = [('A', '.-'), ('B', '-...'), ('C', '-.-.'), ('D', '-..'), ('E', '.'), ('F', '..-.'), ('G', '--.'), ('H', '....'), ('I', '..'), ('J', '.---'), ('K', '-.-'), ('L', '.-..'), ('M', '--'), ('N', '-.'), ('O', '---'), ('P', '.--.'), ('Q', '--.-'), ('R', '.-.'), ('S',
- '...'), ('T', '-'), ('U', '..-'), ('V', '...-'), ('W', '.--'), ('X', '-..-'), ('Y', '-.--'), ('Z', '--..'), ('0', '-----'), ('1', '.----'), ('2', '..---'), ('3', '...--'), ('4', '....-'), ('5', '.....'), ('6', '-....'), ('7', '--...'), ('8', '---..'), ('9', '----.')]
+morse = [
+ ('A', '.-'),
+ ('B', '-...'),
+ ('C', '-.-.'),
+ ('D', '-..'),
+ ('E', '.'),
+ ('F', '..-.'),
+ ('G', '--.'),
+ ('H', '....'),
+ ('I', '..'),
+ ('J', '.---'),
+ ('K', '-.-'),
+ ('L', '.-..'),
+ ('M', '--'),
+ ('N', '-.'),
+ ('O', '---'),
+ ('P', '.--.'),
+ ('Q', '--.-'),
+ ('R', '.-.'),
+ ('S', '...'),
+ ('T', '-'),
+ ('U', '..-'),
+ ('V', '...-'),
+ ('W', '.--'),
+ ('X', '-..-'),
+ ('Y', '-.--'),
+ ('Z', '--..'),
+ ('0', '-----'),
+ ('1', '.----'),
+ ('2', '..---'),
+ ('3', '...--'),
+ ('4', '....-'),
+ ('5', '.....'),
+ ('6', '-....'),
+ ('7', '--...'),
+ ('8', '---..'),
+ ('9', '----.'),
+]
+
# Define a class that represents the morse flasher.
class MorseFlasher:
-
def __init__(self, color=(255, 255, 255)):
# set the color adjusted for brightness
self._color = (

MODIFY
Motorized_Turntable/turntable.py
Motorized_Turntable/turntable.py
-import board
import time
+
+import adafruit_motor.servo
+import board
import pulseio
-from digitalio import DigitalInOut, Direction, Pull
from analogio import AnalogIn
-import adafruit_motor.servo
+from digitalio import DigitalInOut, Direction, Pull
pwm = pulseio.PWMOut(board.D5, frequency=50)
servo = adafruit_motor.servo.Servo(pwm)

MODIFY
Mystical_LED_Halloween_Hood/Mystical_LED_Halloween_Hood.py
Mystical_LED_Halloween_Hood/Mystical_LED_Halloween_Hood.py
import board
import neopixel
-import time
+
try:
import urandom as random # for v1.0 API support
except ImportError:

MODIFY
NeoPixel_Blinkendisc/NeoPixel_Blinkendisc.py
NeoPixel_Blinkendisc/NeoPixel_Blinkendisc.py
+import time
+
+import analogio
import board
import digitalio
-import analogio
import neopixel
-import time
+
try:
import urandom as random # for v1.0 API support
except:

MODIFY
NeoPixel_Dialer/HSV_FancyLED_NeoPixel_Dailer.py
NeoPixel_Dialer/HSV_FancyLED_NeoPixel_Dailer.py
import time
-from analogio import AnalogIn
+
+import adafruit_character_lcd
import adafruit_fancyled.adafruit_fancyled as fancy
import board
import digitalio
-import adafruit_character_lcd
import neopixel
+from analogio import AnalogIn
lcd_rs = digitalio.DigitalInOut(board.D5)
lcd_en = digitalio.DigitalInOut(board.D6)

MODIFY
NeoPixel_Dialer/RGB_NeoPixel_Dialer.py
NeoPixel_Dialer/RGB_NeoPixel_Dialer.py
-import time
import math
-from analogio import AnalogIn
+import time
+
+import adafruit_character_lcd
import board
import digitalio
-import adafruit_character_lcd
import neopixel
+from analogio import AnalogIn
lcd_rs = digitalio.DigitalInOut(board.D5)
lcd_en = digitalio.DigitalInOut(board.D6)

MODIFY
NeoPixel_GoPro_Lens_Light/NeoPixel_GoPro_Lens_Light.py
NeoPixel_GoPro_Lens_Light/NeoPixel_GoPro_Lens_Light.py
-from analogio import AnalogIn
-import board
import time
+
+import board
import neopixel
+from analogio import AnalogIn
pot = AnalogIn(board.A1) # what pin the pot is on
pixpin = board.D0 # what pin the LEDs are on

MODIFY
NeoPixel_Jewel_10_Minute_Necklace/NeoPixel_Jewel_10_Minute_Necklace.py
NeoPixel_Jewel_10_Minute_Necklace/NeoPixel_Jewel_10_Minute_Necklace.py
+import time
+
import board
import neopixel
-import time
pixpin = board.D1
numpix = 7

MODIFY
NeoPixel_Punk_Collar/NeoPixel_Punk_Collar.py
NeoPixel_Punk_Collar/NeoPixel_Punk_Collar.py
-from digitalio import DigitalInOut, Direction
+import time
+
import board
import neopixel
-import time
+from digitalio import DigitalInOut, Direction
pixpin = board.D1
numpix = 5
@@ -49,7 +50,6 @@ def rainbow(wait):
while True:
-
colorWipe((255, 0, 0), .1) # red and delay
colorWipe((0, 255, 0), .1) # green and delay
colorWipe((0, 0, 255), .1) # blue and delay

MODIFY
NeoPixel_Ring_Bangle_Bracelet/Figure_Eight.py
NeoPixel_Ring_Bangle_Bracelet/Figure_Eight.py
+import time
+
import board
import neopixel
-import time
+
try:
import urandom as random
except ImportError:

MODIFY
NeoPixel_Ring_Bangle_Bracelet/Random_Flash.py
NeoPixel_Ring_Bangle_Bracelet/Random_Flash.py
import board
import neopixel
-import time
+
try:
import urandom as random
except ImportError:

MODIFY
NeoPixel_Ring_Bangle_Bracelet/Sine_Wave.py
NeoPixel_Ring_Bangle_Bracelet/Sine_Wave.py
+import time
+
import board
import neopixel
-import time
+
try:
import urandom as random # for v1.0 API support
except ImportError:

MODIFY
NeoPixel_Tiara/NeoPixel_Tiara.py
NeoPixel_Tiara/NeoPixel_Tiara.py
+import time
+
import board
import neopixel
-import time
+
try:
import urandom as random
except ImportError:
@@ -17,7 +19,6 @@ colors = [
def flash_random(wait, howmany):
-
for k in range(howmany):
c = random.randint(0, len(colors) - 1) # Choose random color index

MODIFY
PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython/main.py
PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython/main.py
-from digitalio import DigitalInOut, Direction
import board
import busio
-import time
+from digitalio import DigitalInOut, Direction
+
try:
import struct
except ImportError:

Autformat the rest