Skip to content

Commit fda69dc

Browse files
committed
Template cleanup.
1 parent ac7bd89 commit fda69dc

File tree

25 files changed

+67
-109
lines changed

25 files changed

+67
-109
lines changed

Adafruit_ItsyBitsy_RP2040/neopixel_rainbow/code.py

-22
This file was deleted.

Adafruit_Neo_Trinkey/cap_touch_neopixel_brightness.py Adafruit_Neo_Trinkey/cap_touch_neopixel_brightness/code.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""CircuitPython Capacitive Touch NeoPixel Brightness Control Exmaple"""
1+
"""CircuitPython Capacitive Touch NeoPixel Brightness Control Example"""
22
import time
33
import board
44
import touchio
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""CircuitPython analog pin value example"""
2+
import time
3+
import board
4+
import analogio
5+
6+
analog_pin = analogio.AnalogIn(board.A0)
7+
8+
while True:
9+
print(analog_pin.value)
10+
time.sleep(0.1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""CircuitPython analog voltage value example"""
2+
import time
3+
import board
4+
import analogio
5+
6+
analog_pin = analogio.AnalogIn(board.A0)
7+
8+
9+
def get_voltage(pin):
10+
return (pin.value * 3.3) / 65535
11+
12+
13+
while True:
14+
print(get_voltage(analog_pin))
15+
time.sleep(0.1)

CircuitPython_Templates/status_led_one_neopixel_rainbow.py

-31
This file was deleted.

Adafruit_Feather_RP2040/neopixel_rainbow/code.py CircuitPython_Templates/status_led_one_neopixel_rainbow/code.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
"""CircuitPython NeoPixel Rainbow example for Feather RP2040"""
1+
"""CircuitPython status NeoPixel rainbow example."""
22
import time
33
import board
44
import neopixel
5-
from _pixelbuf import colorwheel
5+
try:
6+
from rainbowio import colorwheel
7+
except ImportError:
8+
try:
9+
from _pixelbuf import colorwheel
10+
except ImportError:
11+
from adafruit_pypixelbuf import colorwheel
612

713
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, auto_write=False)
814

CircuitPython_Templates/onboard_multi_dotstar_rainbow.py CircuitPython_Templates/status_multi_dotstar_rainbow/code.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
For example:
1010
If you are using a FunHouse, change NUMBER_OF_PIXELS to 5.
1111
12-
** Update PIXELBUF_VERSION to _pixelbuf if available for the board (this is the most common case!)
13-
or to adafruit_pypixelbuf where necessary (typically non-Express SAMD21 M0 boards).
14-
15-
For example:
16-
If you are using a FunHouse, change PIXELBUF_VERSION to _pixelbuf.
17-
If you are using a Trinket M0, change PIXELBUF_VERSION to adafruit_pypixelbuf.
18-
1912
** DO NOT INCLUDE THE pylint: disable LINE IN THE GUIDE CODE. It is present only to deal with the
2013
NUMBER_OF_PIXELS variable being undefined, and the dots setup line being too long with the variable
2114
in it in this pseudo-code. As you will be updating the variable in the guide, you will not need
@@ -26,7 +19,13 @@
2619
import time
2720
import board
2821
import adafruit_dotstar
29-
from PIXELBUF_VERSION import colorwheel
22+
try:
23+
from rainbowio import colorwheel
24+
except ImportError:
25+
try:
26+
from _pixelbuf import colorwheel
27+
except ImportError:
28+
from adafruit_pypixelbuf import colorwheel
3029

3130
dots = adafruit_dotstar.DotStar(board.DOTSTAR_CLOCK, board.DOTSTAR_DATA, NUMBER_OF_PIXELS, auto_write=False)
3231
dots.brightness = 0.3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""
2+
CircuitPython Essentials Storage CP Filesystem boot.py file
3+
4+
There are three things to be updated in this file to match your board:
5+
* Update OBJECT_NAME to match the physical thing you are using, e.g. button or pin.
6+
* Update OBJECT_PIN to match the pin name to which the button or pin is attached.
7+
* Update UP_OR_DOWN to match the Pull necessary for the chosen pin.
8+
9+
For example:
10+
If using the up button on a FunHouse, update OBJECT_NAME to button, and OBJECT_PIN to BUTTON_UP.
11+
If using pin A0 on a Feather RP2040, update OBJECT_NAME to pin, and OBJECT_PIN to A0.
12+
13+
For example:
14+
If using the up button on a FunHouse, update UP_OR_DOWN to DOWN.
15+
IF using pin A0 on a Feather RP2040, update UP_OR_DOWN to UP.
16+
"""
17+
import board
18+
import digitalio
19+
import storage
20+
21+
OBJECT_NAME = digitalio.DigitalInOut(board.OBJECT_PIN)
22+
OBJECT_NAME.switch_to_input(pull=digitalio.Pull.UP_OR_DOWN)
23+
24+
# If the OBJECT_NAME is connected to ground, the filesystem is writable by CircuitPython
25+
storage.remount("/", readonly=OBJECT_NAME.value)

MacroPad_Braille_Keycaps/code.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
for index in range(12):
4141
x = index % 3
4242
y = index // 3
43-
labels.append(label.Label(terminalio.FONT, text=label_names[index], max_glyphs=10))
43+
labels.append(label.Label(terminalio.FONT, text=label_names[index]))
4444
layout.add_content(labels[index], grid_position=(x, y), cell_size=(1, 1))
4545

4646
# Display the text

NeoKey_Trinkey/CircuitPython_NeoPixel_Example/code.py

-22
This file was deleted.

QT_Py_RP2040/neopixel_rainbow/code.py

-22
This file was deleted.

0 commit comments

Comments
 (0)