Skip to content

Commit 522677b

Browse files
committed
2 parents 6fdcda1 + 4cf4a9e commit 522677b

File tree

87 files changed

+74880
-75
lines changed

Some content is hidden

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

87 files changed

+74880
-75
lines changed

.github/workflows/githubci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
arduino-platform: ["uno", "nrf52832", "cpx_ada", "pyportal", "protrinket_3v", "protrinket_5v", "metro_m0", "esp8266", "esp32", "trinket_3v", "trinket_5v", "gemma", "flora", "feather32u4", "feather_m0_express", "gemma_m0", "trinket_m0", "hallowing_m0", "monster_m4sk", "hallowing_m4", "neotrellis_m4", "pybadge", "cpb"]
10+
arduino-platform: ["uno", "nrf52832", "cpx_ada", "pyportal", "protrinket_3v", "protrinket_5v", "metro_m0", "esp8266", "esp32", "trinket_3v", "trinket_5v", "gemma", "flora", "feather32u4", "feather_m0_express", "gemma_m0", "trinket_m0", "hallowing_m0", "monster_m4sk", "hallowing_m4", "neotrellis_m4", "pybadge", "cpb", "cpc"]
1111

1212
runs-on: ubuntu-latest
1313

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

BusyBox_Sign/code.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import time
2+
import board
3+
import neopixel
4+
from adafruit_led_animation.animation.comet import Comet
5+
from adafruit_led_animation.animation.pulse import Pulse
6+
from adafruit_led_animation.animation.blink import Blink
7+
from adafruit_led_animation.animation.rainbow import Rainbow
8+
from adafruit_led_animation.animation.colorcycle import ColorCycle
9+
from adafruit_led_animation.sequence import AnimationSequence
10+
from adafruit_led_animation import helper
11+
from adafruit_led_animation.color import PURPLE, AQUA, RED, JADE, ORANGE, YELLOW, BLUE
12+
13+
#Setup NeoPixels
14+
pixel_pin = board.D6
15+
pixel_num = 16
16+
pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=.9, auto_write=False)
17+
18+
#Setup NeoPixel Grid
19+
pixel_wing_vertical = helper.PixelMap.vertical_lines(
20+
pixels, 8, 2, helper.horizontal_strip_gridmap(8, alternating=True)
21+
)
22+
pixel_wing_horizontal = helper.PixelMap.horizontal_lines(
23+
pixels, 8, 2, helper.horizontal_strip_gridmap(8, alternating=True)
24+
)
25+
26+
#Setup LED Animations
27+
rainbow = Rainbow(pixels, speed=.001, period=2)
28+
pulse = Pulse(pixels, speed=0.1, color=RED, period=3)
29+
blink = Blink(pixels, speed=0.5, color=RED)
30+
colorcycle = ColorCycle(pixels, speed=0.4, colors=[RED, ORANGE, YELLOW, JADE, BLUE, AQUA, PURPLE])
31+
comet_v = Comet(pixel_wing_vertical, speed=0.05, color=PURPLE, tail_length=6, bounce=True)
32+
33+
#Setup the LED Sequences
34+
animations = AnimationSequence(
35+
rainbow,
36+
pulse,
37+
comet_v,
38+
blink,
39+
colorcycle,
40+
advance_interval=5.95,
41+
)
42+
43+
#Run ze animations!
44+
while True:
45+
animations.animate()

0 commit comments

Comments
 (0)