Skip to content

Commit ae55355

Browse files
authored
Merge branch 'master' into patch-6
2 parents bb6dc51 + dc86934 commit ae55355

File tree

5 files changed

+81
-3
lines changed

5 files changed

+81
-3
lines changed

Adafruit_Feather_Sense/feather_sense_sensor_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
import adafruit_apds9960.apds9960
88
import adafruit_bmp280
99
import adafruit_lis3mdl
10-
import adafruit_lsm6ds
10+
import adafruit_lsm6ds.lsm6ds33
1111
import adafruit_sht31d
1212

1313
i2c = board.I2C()
1414

1515
apds9960 = adafruit_apds9960.apds9960.APDS9960(i2c)
1616
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)
1717
lis3mdl = adafruit_lis3mdl.LIS3MDL(i2c)
18-
lsm6ds33 = adafruit_lsm6ds.LSM6DS33(i2c)
18+
lsm6ds33 = adafruit_lsm6ds.lsm6ds33.LSM6DS33(i2c)
1919
sht31d = adafruit_sht31d.SHT31D(i2c)
2020
microphone = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA,
2121
sample_rate=16000, bit_depth=16)

Bitcoin_Matrix/bitcoin_background.bmp

6.05 KB
Binary file not shown.

Bitcoin_Matrix/bitcoin_matrix.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Run on Metro M4 Airlift w RGB Matrix shield and 64x32 matrix display
2+
# show current value of Bitcoin in USD
3+
4+
import time
5+
import board
6+
import terminalio
7+
from adafruit_matrixportal.matrixportal import MatrixPortal
8+
9+
# You can display in 'GBP', 'EUR' or 'USD'
10+
CURRENCY = "USD"
11+
# Set up where we'll be fetching data from
12+
DATA_SOURCE = "https://api.coindesk.com/v1/bpi/currentprice.json"
13+
DATA_LOCATION = ["bpi", CURRENCY, "rate_float"]
14+
15+
16+
def text_transform(val):
17+
if CURRENCY == "USD":
18+
return "$%d" % val
19+
if CURRENCY == "EUR":
20+
return "‎€%d" % val
21+
if CURRENCY == "GBP":
22+
return "£%d" % val
23+
return "%d" % val
24+
25+
26+
# the current working directory (where this file is)
27+
cwd = ("/" + __file__).rsplit("/", 1)[0]
28+
29+
matrixportal = MatrixPortal(
30+
url=DATA_SOURCE,
31+
json_path=DATA_LOCATION,
32+
status_neopixel=board.NEOPIXEL,
33+
default_bg=cwd + "/bitcoin_background.bmp",
34+
debug=True,
35+
)
36+
37+
matrixportal.add_text(
38+
text_font=terminalio.FONT,
39+
text_position=(27, 16),
40+
text_color=0x3d1f5c,
41+
text_transform=text_transform,
42+
)
43+
matrixportal.preload_font(b"$012345789") # preload numbers
44+
matrixportal.preload_font((0x00A3, 0x20AC)) # preload gbp/euro symbol
45+
46+
while True:
47+
try:
48+
value = matrixportal.fetch()
49+
print("Response is", value)
50+
except (ValueError, RuntimeError) as e:
51+
print("Some error occured, retrying! -", e)
52+
53+
time.sleep(3 * 60) # wait 3 minutes

NeoPixel_Gemma_Torch/code.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import board
2+
import neopixel
3+
import adafruit_dotstar
4+
5+
LED = adafruit_dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1) #Setup Internal Dotar
6+
LED.brightness = 0.8 #DotStar brightness
7+
8+
NUMPIX = 7 # Number of NeoPixels
9+
PIXPIN = board.D2 # Pin where NeoPixels are connected
10+
PIXELS = neopixel.NeoPixel(PIXPIN, NUMPIX) # NeoPixel object setup
11+
12+
RED = 7 #Number of pixels to be red
13+
BLUE = 0 #First pixel
14+
15+
while True: # Loop forever...
16+
#Make the internal dotstar light up.
17+
LED[0] = (100, 0, 255)
18+
19+
#Select these pixels starting with the second pixel.
20+
for i in range(1, RED):
21+
# Make the pixels red
22+
PIXELS[i] = (100, 0, 0)
23+
24+
#Make the first neopixel this color
25+
PIXELS[BLUE] = (0, 0, 100)

pyportal_pet_planter/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
MQTT.set_socket(socket, esp)
186186

187187
# Initialize a new MQTT Client object
188-
mqtt_client = MQTT.MQTT(broker="https://io.adafruit.com",
188+
mqtt_client = MQTT.MQTT(broker="io.adafruit.com",
189189
username=secrets["aio_user"],
190190
password=secrets["aio_key"])
191191

0 commit comments

Comments
 (0)