Skip to content

Commit 2c05295

Browse files
authored
Merge pull request #2093 from kattni/tft-feather-cp-templates
TFT Feather template code and license updates.
2 parents 4c7a5ea + fe33ebc commit 2c05295

File tree

49 files changed

+128
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+128
-141
lines changed

Adafruit_Feather_ESP32-S2/Analog_In/code.py

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
"""
4+
CircuitPython Essentials Storage CP Filesystem boot.py file
5+
"""
6+
import time
7+
import board
8+
import digitalio
9+
import storage
10+
import neopixel
11+
12+
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
13+
14+
button = digitalio.DigitalInOut(board.BUTTON)
15+
button.switch_to_input(pull=digitalio.Pull.UP)
16+
17+
# Turn the NeoPixel white for one second to indicate when to press the boot button.
18+
pixel.fill((255, 255, 255))
19+
time.sleep(1)
20+
21+
# If the button is connected to ground, the filesystem is writable by CircuitPython
22+
storage.remount("/", readonly=button.value)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
"""
4+
CircuitPython Essentials Storage CP Filesystem code.py file
5+
For use with boards with a built-in red LED.
6+
"""
7+
import time
8+
import board
9+
import digitalio
10+
import microcontroller
11+
12+
led = digitalio.DigitalInOut(board.LED)
13+
led.switch_to_output()
14+
15+
try:
16+
with open("/temperature.txt", "a") as temp_log:
17+
while True:
18+
# The microcontroller temperature in Celsius. Include the
19+
# math to do the C to F conversion here, if desired.
20+
temperature = microcontroller.cpu.temperature
21+
22+
# Write the temperature to the temperature.txt file every 10 seconds.
23+
temp_log.write('{0:.2f}\n'.format(temperature))
24+
temp_log.flush()
25+
26+
# Blink the LED on every write...
27+
led.value = True
28+
time.sleep(1) # ...for one second.
29+
led.value = False # Then turn it off...
30+
time.sleep(9) # ...for the other 9 seconds.
31+
32+
except OSError as e: # When the filesystem is NOT writable by CircuitPython...
33+
delay = 0.5 # ...blink the LED every half second.
34+
if e.args[0] == 28: # If the file system is full...
35+
delay = 0.15 # ...blink the LED every 0.15 seconds!
36+
while True:
37+
led.value = not led.value
38+
time.sleep(delay)

Adafruit_QT_Py_ESP32-S2/Analog_In/code.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

Adafruit_QT_Py_ESP32-S2/Capacitive_Touch_One_Pin/code.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

Adafruit_QT_Py_ESP32-S2/Capacitive_Touch_Two_Pins/code.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

Adafruit_QT_Py_ESP32-S2/Digital_Input/code.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

Adafruit_QT_Py_ESP32-S2/Storage/boot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2-
# SPDX-License-Identifier: Unlicense
2+
# SPDX-License-Identifier: MIT
33
"""
44
CircuitPython Essentials Storage CP Filesystem boot.py file
55
"""

Adafruit_QT_Py_ESP32-S2/Storage/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2-
# SPDX-License-Identifier: Unlicense
2+
# SPDX-License-Identifier: MIT
33
"""
44
CircuitPython Essentials Storage CP Filesystem code.py file
55
"""

CircuitPython_Templates/Analog_Pin_Values_Nonstandard_AREF/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2-
# SPDX-License-Identifier: Unlicense
2+
# SPDX-License-Identifier: MIT
33
"""
44
CircuitPython analog voltage value example
55

0 commit comments

Comments
 (0)