Compare commits

..

558 commits

Author SHA1 Message Date
foamyguy
62453248a6
Merge pull request #3114 from FoamyGuy/add_spell_jam
Add Spell Jam project
2025-08-28 15:41:37 -05:00
foamyguy
52c757ac36 remove lamda pylint exception 2025-08-28 15:28:43 -05:00
foamyguy
f5fec0e46b add Spell Jam project 2025-08-28 15:22:28 -05:00
foamyguy
009abaff09 revert accidental commit 2025-08-28 15:18:54 -05:00
foamyguy
f34bab8fd8 add icon and metadata for Fruit Jam OS 2025-08-28 15:01:55 -05:00
foamyguy
02dc51166e Adding Spell Jam 2025-08-28 14:54:34 -05:00
foamyguy
1edc2c70fd
Merge pull request #3113 from FoamyGuy/kittentts_version
update to KittenTTS 0.2 model.
2025-08-22 15:26:06 -05:00
foamyguy
9f9d11ebc9 update to KittenTTS 0.2 model. 2025-08-22 14:53:27 -05:00
foamyguy
4aef934371
Merge pull request #3111 from RetiredWizard/fruitjamminemouse
Add check to skip over keyboard
2025-08-20 15:05:51 -05:00
John Edgar Park
c810b4e2a1
Merge pull request #3112 from jedgarpark/bt-keeb-bridge
Bt keeb bridge
2025-08-20 07:48:04 -07:00
RetiredWizard
8feb030e57 remove CIRCUITPYTHON_TERMINAL display before no mouse error 2025-08-20 10:47:01 -04:00
foamyguy
a48db8f2c2
Merge pull request #3104 from RetiredWizard/fruitjampypaint
Update PyPaint learn guide files for use with Fruit Jam OS
2025-08-20 08:17:14 -05:00
jedgarpark
992f57f2f6 added test files 2025-08-19 19:42:54 -07:00
jedgarpark
18d5dbaf48 first commit BT unified keyboard bridge 2025-08-19 19:37:53 -07:00
RetiredWizard
2fcfe4a686 add mouse sensitivity parameter 2025-08-19 18:43:00 -04:00
RetiredWizard
900e93f146 remove a couple more unneeded class variables 2025-08-19 18:21:31 -04:00
RetiredWizard
f80086a15e don't need structure for mouse buffer anymore 2025-08-19 18:17:05 -04:00
RetiredWizard
5ad0efac9f use adafruit_usb_host_mouse 2025-08-19 18:11:26 -04:00
RetiredWizard
46c942051d replace generated comment with better detail 2025-08-19 16:55:39 -04:00
RetiredWizard
4fcd255f87 Avoids infinite loop if no USB devices are attached 2025-08-19 16:51:46 -04:00
RetiredWizard
5fbb8d9277 cleanup trailing spaces for pylint 2025-08-19 16:37:08 -04:00
RetiredWizard
8f89fe23c1 ignore no endpoint failures from mouse.read 2025-08-19 16:32:30 -04:00
RetiredWizard
59fe2fb599 pylint caught this for me 2025-08-19 15:20:09 -04:00
RetiredWizard
318448cc64 Use find_boot_mouse_endpoint 2025-08-19 15:14:42 -04:00
RetiredWizard
a011ecf509 Add check to skip over keyboard 2025-08-18 21:59:29 -04:00
foamyguy
d0cb33b6fc
Merge pull request #3110 from FoamyGuy/neopot
update NeoPot arduino example for metro328
2025-08-18 15:36:40 -05:00
foamyguy
8a376de77e update arduino example for metro328 2025-08-18 15:16:17 -05:00
Anne Barela
ec8fdd1cf6
Merge pull request #3109 from adafruit/TheKitty-patch-12
Update code.py
2025-08-18 15:53:40 -04:00
Anne Barela
fac7d8155e
Update code.py
Update for either of the accelerometers on the Feather Sense
2025-08-18 15:48:35 -04:00
Anne Barela
77bd7db8fe
Merge pull request #3108 from adafruit/TheKitty-patch-12
Update code.py to support either of the accelerometers on the Adafruit Feather nRF52840 Sense
2025-08-18 15:44:14 -04:00
Anne Barela
92ac6f3aa4
Update code.py
Lint
2025-08-18 15:40:39 -04:00
Anne Barela
708341d067
Update code.py
Use code from https://learn.adafruit.com/adafruit-feather-sense/circuitpython-sense-demo to check between the two IMUs that may be on the Adafruit Feather Sense
2025-08-18 15:31:39 -04:00
foamyguy
015b1f321d
Merge pull request #3107 from FoamyGuy/neopot
NeoPot example code
2025-08-18 11:58:25 -05:00
foamyguy
7057bc7a1f NeoPot example code 2025-08-18 11:41:07 -05:00
RetiredWizard
5ac9e6cd2e soo close, this one should do it 2025-08-15 18:15:52 -04:00
RetiredWizard
4e9c1239de still trying to disable the pylint check 2025-08-15 18:10:59 -04:00
RetiredWizard
d4483b0d1d another try for the last pylint error 2025-08-15 18:03:28 -04:00
RetiredWizard
af83bf3cde last pylint problem 2025-08-15 17:53:48 -04:00
RetiredWizard
0ef12d6fb2 more pylint fixes 2025-08-15 17:45:29 -04:00
RetiredWizard
5a18411aee pylint and associated fixes - removed adafruit_logger 2025-08-15 17:30:06 -04:00
RetiredWizard
3f902f837a move changes to new folder leaving original as it was 2025-08-15 16:34:35 -04:00
foamyguy
3a7683e728
Merge pull request #3102 from RetiredWizard/fruitjammines
Minesweeper Change to relative paths for Fruit Jam OS
2025-08-15 10:45:35 -05:00
RetiredWizard
21ce0d8ae1 change usb mouse debug prints to adafruit_logging msgs 2025-08-12 19:39:10 -04:00
foamyguy
1daa2d72aa
Merge pull request #3105 from FoamyGuy/add_pi_kittentts
Add pi kittentts demo project
2025-08-12 11:08:29 -05:00
foamyguy
2a399b4f0f eof newline 2025-08-12 10:16:22 -05:00
foamyguy
afabe616a2 adding Pi KittenTTS demo code 2025-08-12 10:14:43 -05:00
RetiredWizard
a5a62a1584 minor fill performance improvement 2025-08-11 13:43:38 -04:00
RetiredWizard
4f153b0321 Turn off fill debug prints 2025-08-10 00:46:43 -04:00
RetiredWizard
5b29480e9f Update learn guide files for use with Fruit Jam OS 2025-08-10 00:05:19 -04:00
RetiredWizard
06ccf1cc75 Change to relative paths for bitmap files 2025-08-07 23:06:45 -04:00
foamyguy
e804e240a6
Merge pull request #3100 from FoamyGuy/fruit_jam_examples
fruit jam arduino sd card read write
2025-08-06 14:19:11 -05:00
foamyguy
4cf64fda77 fruit jam arduino sd card read write 2025-08-06 13:44:37 -05:00
Liz
a616a09177
Merge pull request #3099 from adafruit/quad_eink
quad color eInk demos
2025-08-05 21:07:28 -04:00
Liz
fc5f3391cb Merge branch 'main' into quad_eink 2025-08-05 20:19:44 -04:00
Liz
e4690a4bdc
Merge pull request #3098 from adafruit/fruit_jam_factory
add fruit jam full test
2025-08-05 20:14:38 -04:00
Liz
53dce06f35 quad color eInk demos 2025-08-05 19:56:35 -04:00
Liz
8fff1f5508 revert, revert 2025-08-05 17:52:36 -04:00
Liz
006fa45afc testbed now requires tinyusb 2025-08-05 16:33:03 -04:00
Liz
0892b2226f update test 2025-08-05 16:14:37 -04:00
foamyguy
5e539a6626
Merge pull request #3094 from RetiredWizard/chipsfixes
Generalizations on Metro_RP2350_Chips_Challenge  for Fruit Jam
2025-08-05 09:35:13 -05:00
foamyguy
a2a056457a
Merge pull request #3096 from FoamyGuy/fruit_jam_examples
Fruit Jam CircuitPython examples
2025-08-04 15:14:12 -05:00
foamyguy
d655c5892c pylint 2025-08-04 14:50:12 -05:00
Liz
c8273475d2 add fruit jam full test 2025-08-04 15:29:09 -04:00
John Edgar Park
11fb234c19
Merge pull request #3097 from jedgarpark/espnow-basics
fixed status_label looping and error message timing
2025-08-04 12:02:02 -07:00
jedgarpark
667bb38009 fixed status_label looping and error message timing 2025-08-04 11:49:28 -07:00
foamyguy
934ad21830 WIFI example 2025-08-04 11:45:07 -05:00
Melissa LeBlanc-Williams
4919e360c9
Merge pull request #3095 from FoamyGuy/minesweeper_title_icon_fruitjam_os
add metadata file to Minesweeper for fruit jam OS icon and title.
2025-08-02 12:22:17 -07:00
RetiredWizard
0fa89fd711 Fix pylint errors for unspecified try/except blocks 2025-08-02 13:48:58 -04:00
foamyguy
6a8f7a3841 add metadata file to Minesweeper for fruit jam OS icon and title. 2025-08-02 11:13:11 -05:00
foamyguy
6b2c4ee4f2 fruit jam circuitpython examples 2025-08-02 10:43:10 -05:00
RetiredWizard
990b4eee37 Found similar absolute/relative folder issues in Larsio Paint 2025-08-02 01:57:50 -04:00
RetiredWizard
9af149971f Generalizations for Fruit Jam 2025-08-01 19:58:54 -04:00
Liz
1cd99ab0fd
Merge pull request #3093 from adafruit/as5600_encoder
code for AS5600 encoder project
2025-08-01 16:30:15 -04:00
Liz
78373685c1 code for AS5600 encoder project
CircuitPython code to control CC volume with a magnet and AS5600 sensor
2025-08-01 16:21:50 -04:00
Liz
1930a2ff6e
Merge pull request #3092 from adafruit/keyset_midi
adding keyset midi controller code
2025-08-01 13:31:32 -04:00
Dan Halbert
371bd7ba16
Merge pull request #3091 from dhalbert/update-jeplayer
Update JEPlayer for adafruit_progressbar changes; fix background.bmp
2025-08-01 13:11:05 -04:00
Liz
20bcb16713 adding keyset midi controller code 2025-08-01 12:57:32 -04:00
Dan Halbert
83402f3a1f Update JEPlayer for adafruit_progressbar changes; fix background.bmp 2025-08-01 12:30:18 -04:00
John Edgar Park
4a80a4ac71
Merge pull request #3089 from jedgarpark/espnow-basics
first commit esp-now basics
2025-08-01 07:35:20 -07:00
jedgarpark
43d9f48009 fixed error 2025-07-31 20:27:41 -07:00
jedgarpark
1da3c7916a first commit esp-now basics 2025-07-31 20:20:00 -07:00
foamyguy
e44ae3524b
Merge pull request #3088 from FoamyGuy/fruitjam_irc
Fruit Jam IRC app
2025-07-29 11:12:57 -05:00
foamyguy
f8c2b61fea more pylint 2025-07-29 10:30:35 -05:00
foamyguy
f5f0805802 pylint and format 2025-07-29 10:21:40 -05:00
foamyguy
b036cc6252 icon and metadata for FJOS 2025-07-29 10:01:06 -05:00
foamyguy
d22c263f6f fruit jam IRC app 2025-07-29 09:37:52 -05:00
foamyguy
895120fd8c
Merge pull request #3087 from FoamyGuy/magtag_updates
Change deprecated splash usage to root_group
2025-07-28 16:02:31 -05:00
foamyguy
989db55caf change deprecated splash usage to root_group 2025-07-25 16:46:08 -05:00
Liz
c5510041a3
Merge pull request #3086 from ladyada/main
update for magtag with ssd1680z chip
2025-07-21 16:05:26 -04:00
ladyada
5dd86b8c17 Merge branch 'main' of github.com:adafruit/Adafruit_Learning_System_Guides 2025-07-21 15:28:45 -04:00
ladyada
bef5610af2 for new magtag! 2025-07-21 15:28:40 -04:00
foamyguy
97cef46969
Merge pull request #3085 from FoamyGuy/hstx_dvi_cowbell
HXTX DVI CowBell Arduino Examples
2025-07-21 09:14:38 -05:00
foamyguy
44e4cdd4d5 remove 2350 example, update comment in 2040 example 2025-07-21 08:57:57 -05:00
foamyguy
f4eee1ff6a add license info 2025-07-17 17:34:52 -05:00
foamyguy
0ecae41d6f try .pico_rp2350.test.only 2025-07-17 17:29:45 -05:00
foamyguy
8be7f75668 move circuitpython to subdir, add arduino examples 2025-07-17 17:16:08 -05:00
Anne Barela
d628b2fa2d
Merge pull request #3084 from adafruit/TheKitty-patch-12
Create DVI_Framebuffer.py
2025-07-15 18:56:48 -04:00
Anne Barela
fc6bad3636
Update DVI_Framebuffer.py 2025-07-15 18:53:28 -04:00
Anne Barela
99f722ba6b
Create DVI_Framebuffer.py 2025-07-15 18:49:23 -04:00
Anne Barela
be3293915c
Add font files 2025-07-15 18:35:13 -04:00
Anne Barela
2dfcdd5fa2
Create README.md 2025-07-15 18:34:46 -04:00
Anne Barela
475f919788
Merge pull request #3083 from adafruit/TheKitty-patch-12
Update ANSI_color_terminal.py
2025-07-15 18:32:23 -04:00
Anne Barela
06a13af737
Update ANSI_color_terminal.py 2025-07-15 18:27:49 -04:00
Anne Barela
aada1d7b11
Update ANSI_color_terminal.py 2025-07-15 18:19:52 -04:00
Anne Barela
9b3ef79216
Create ANSI_color_terminal.py 2025-07-15 18:18:01 -04:00
Anne Barela
77ca9ce529
Rename SImple_Terminal.py to Simple_Terminal.py 2025-07-15 18:08:33 -04:00
Anne Barela
40573e41a8
Merge pull request #3081 from adafruit/TheKitty-patch-10
Create Simple_Terminal.py
2025-07-15 18:07:02 -04:00
Anne Barela
8c4a1b3307
Merge pull request #3078 from FoamyGuy/hstx_dvi_cowbell
update hstx dvi cowbell example
2025-07-15 18:06:46 -04:00
Anne Barela
ec4ca90328
Merge pull request #3082 from adafruit/TheKitty-patch-11
Create LVGL_Font_Terminal.py
2025-07-15 18:06:36 -04:00
Anne Barela
10b9ab827a
Update LVGL_Font_Terminal.py 2025-07-15 18:02:01 -04:00
Anne Barela
02d7caf6a2
Update SImple_Terminal.py 2025-07-15 18:01:19 -04:00
Anne Barela
dff0bbb611
Create LVGL_Font_Terminal.py
For guide
2025-07-15 17:58:21 -04:00
Anne Barela
3c7e161f93
Create SImple_Terminal.py 2025-07-15 17:53:51 -04:00
Anne Barela
78cc309fdd
Merge pull request #3079 from adafruit/TheKitty-patch-8
Create Display_LVGL_Font.py
2025-07-15 17:43:27 -04:00
Anne Barela
6216a8a69e
Update Display_LVGL_Font.py 2025-07-15 17:40:26 -04:00
Anne Barela
572e952434
Merge pull request #3080 from adafruit/TheKitty-patch-9
Create Display_BDF_PCF_Font.py
2025-07-15 16:57:06 -04:00
Anne Barela
a93818885f
Update Display_LVGL_Font.py 2025-07-15 16:56:00 -04:00
Anne Barela
ea96a5dba3
Update Display_BDF_PCF_Font.py 2025-07-15 16:51:06 -04:00
Anne Barela
aa83302a9b
Update Display_LVGL_Font.py 2025-07-15 16:50:21 -04:00
Anne Barela
f245bf8838
Create Display_BDF_PCF_Font.py
For Guide
2025-07-15 16:47:31 -04:00
Anne Barela
d65ebe2b99
Update Display_LVGL_Font.py 2025-07-15 16:45:00 -04:00
Anne Barela
632b3f5d2c
Create Display_LVGL_Font.py 2025-07-15 16:36:53 -04:00
foamyguy
d1484a30b1 use setup_display.py instead of boot.py for display init 2025-07-15 15:24:11 -05:00
Anne Barela
e579992b2f
Merge pull request #3077 from adafruit/TheKitty-patch-7
Update Find_EDID_Values.py
2025-07-15 16:11:42 -04:00
Anne Barela
574bf886a5
Update Find_EDID_Values.py
whitespace
2025-07-15 16:00:46 -04:00
Anne Barela
00f6b46aa6
Fix lint issues 2025-07-15 15:51:57 -04:00
Anne Barela
7c9ed24d5a
Update Find_EDID_Values.py 2025-07-15 15:37:49 -04:00
Anne Barela
8776b77ed6
Create Find_EDID_Values.py 2025-07-15 15:36:27 -04:00
Anne Barela
064a654ef3
Rename Fruit_Jam/CircuitPython_DVI to Fruit_Jam/CircuitPython_DVI_Video/README.md 2025-07-15 15:32:37 -04:00
Anne Barela
069a27ac4e
Create CircuitPython_DVI 2025-07-15 15:31:30 -04:00
foamyguy
6546f20d1e
Merge pull request #3076 from FoamyGuy/hstx_dvi_cowbell
hstx dvi cowbell example
2025-07-15 13:50:56 -05:00
foamyguy
be14e2cff6 hstx dvi cowbell example 2025-07-15 12:33:09 -05:00
Liz
fd3535b6b1
Merge pull request #3075 from adafruit/ideal_diode
adding ideal diode examples
2025-07-15 09:02:42 -04:00
Liz
cb3a07bb25 adding ideal diode examples 2025-07-15 08:20:39 -04:00
Liz
48a837c8ff
Merge pull request #3074 from adafruit/soil_sensor
additional soil sensor examples
2025-07-14 18:03:23 -04:00
Liz
b74bbaf033 additional soil sensor examples 2025-07-14 17:24:54 -04:00
Liz
e9b900c317
Merge pull request #3073 from adafruit/soil_sensor
simple soil sensor examples
2025-07-10 09:08:02 -04:00
Liz
3efeca69df simple soil sensor examples
adding micropython and arduino examples for simple soil sensor
2025-07-09 19:51:50 -04:00
John Edgar Park
caffaec092
Merge pull request #3072 from jedgarpark/knobby-seq
first commit Knobby Seq
2025-07-09 10:51:35 -07:00
jedgarpark
083883fbac first commit Knobby Seq 2025-07-08 19:08:52 -07:00
Liz
85eb5522a2
Merge pull request #3071 from adafruit/thermal_pi
adding raspberry pi thermal camera code
2025-07-02 22:09:42 -04:00
Liz
31426aeddc adding raspberry pi thermal camera code
Adding raspberry pi thermal camera overlay code. uses pi camera 3 and mlx90640
2025-07-02 20:20:36 -04:00
Limor "Ladyada" Fried
235f0c4938
Merge pull request #3070 from adafruit/dac_volume
change volume parameter
2025-06-30 10:41:41 -04:00
Mikey Sklar
c6f4f3ad91 change volume parameter 2025-06-29 18:33:12 -07:00
foamyguy
31240bf5aa
Merge pull request #3069 from FoamyGuy/odb_api_update
Use new OnDiskBitmap API
2025-06-27 15:24:06 -05:00
foamyguy
0b0c4ebbbd fix variable name 2025-06-27 15:18:24 -05:00
foamyguy
62512cab4a use new OnDiskBitmap API 2025-06-27 15:11:50 -05:00
foamyguy
a254b46192 use new OnDiskBitmap API 2025-06-27 14:41:01 -05:00
Limor "Ladyada" Fried
60d17f12c8
Merge pull request #3068 from FoamyGuy/fix_solder_profile
add missing comma to solder profile in EZMake oven
2025-06-27 11:20:22 -04:00
foamyguy
b263b9684b add missing comma 2025-06-27 09:59:27 -05:00
foamyguy
2b4475bbc7
Merge pull request #3065 from FoamyGuy/cp_logger_fixes
CircuitPython Logger fixes
2025-06-20 10:24:13 -05:00
foamyguy
16145663c1 fix aio handler init. Fix ble handler functionality. Remove go() function from code.pys 2025-06-20 10:07:47 -05:00
foamyguy
463ac6586b fix logger handler classes, remove skip file 2025-06-20 09:22:05 -05:00
foamyguy
82e3a2adca
Merge pull request #3064 from FoamyGuy/adding_icons_and_metadata
adding some icons and metadata for fruitjam os
2025-06-17 16:34:55 -05:00
foamyguy
f57629a8ae pylint fixes, remove unused imports 2025-06-17 15:17:36 -05:00
foamyguy
edfec3d15f Merge branch 'refs/heads/main' into adding_icons_and_metadata
# Conflicts:
#	Metro/Metro_RP2350_CircuitPython_Matrix/code.py
2025-06-17 15:07:31 -05:00
Liz
8dae72946e
Merge pull request #3051 from FoamyGuy/deepsleep_bme280_aio
feather s2 bme280 deepsleep aio example
2025-06-16 14:41:34 -04:00
foamyguy
6994ee09d3 remove magtag reference, update comments 2025-06-16 09:07:06 -05:00
foamyguy
d7cdb81494 additional comments 2025-06-13 14:57:43 -05:00
Liz
043497405a
Merge pull request #3063 from adafruit/typewriter
code for not a typewriter
2025-06-13 15:28:54 -04:00
foamyguy
f393f2762d
Merge pull request #3062 from FoamyGuy/sd_excepts
update sd examples for 10.x behavior
2025-06-13 14:04:43 -05:00
Liz
dbf2a4301e lint 2025-06-13 14:24:50 -04:00
Liz
5b4ba29cc2 code for not a typewriter
both versions of the not a typewriter code. one uses only circuitpython with usb host for a usb keyboard. the second has a desktop python script that communicates with the feather over serial
2025-06-13 14:17:55 -04:00
foamyguy
748f988a52 expand SD comments, remove leftover comment section, remove 10x specific files 2025-06-13 11:54:11 -05:00
foamyguy
d40ddef917 Merge branch 'refs/heads/main' into sd_excepts 2025-06-13 11:46:46 -05:00
Mikey Sklar
736bedf957
Merge pull request #3061 from adafruit/metro-rp2350-CP10x-SD
Metro RP2350 demo code for CircuitPython 10.x SD card list and write. The 9.x examples are not compatible.
2025-06-13 09:34:15 -07:00
foamyguy
3d3d29ccc1 update sd examples for 10.x behavior 2025-06-13 11:28:32 -05:00
Mikey Sklar
112721fecd Metro RP2350 CP 10.x /sd
Demo code for CircuitPython 10.x SD card list and write. The 9.x examples are not compatible.
2025-06-13 09:11:03 -07:00
Tyeth Gundry
57a70ad9e7
Merge pull request #3060 from adafruit/final-template-fixes
Final template fixes
2025-06-13 15:48:45 +01:00
Tyeth Gundry
ebdcc74cf3
Correct Week to Day, and one They're to their 2025-06-13 15:46:34 +01:00
foamyguy
66e82e79d2
Merge pull request #3059 from FoamyGuy/fruitjam_startups
fruitjam startup screens
2025-06-12 15:40:15 -05:00
foamyguy
054e7c443c remove pylint disables, add license comment 2025-06-12 15:23:53 -05:00
foamyguy
4d2c3e147c fruitjam startup screens 2025-06-12 15:05:37 -05:00
Tyeth Gundry
1fb7ac8df2
Accept total_events=0, tighten whitespace, correct "you" to "they" 2025-06-11 14:49:17 +01:00
Tyeth Gundry
cee73a11c7
Merge pull request #3058 from adafruit/capture-to-assign-footer
Update template.liquid - swap capture to assign
2025-06-11 12:27:42 +01:00
Tyeth Gundry
047f53e1ad
Update template.liquid - swap capture to assign 2025-06-11 12:27:09 +01:00
Tyeth Gundry
50fff0047f
Merge pull request #3057 from tyeth/add-potty-training
Add potty training
2025-06-10 23:55:17 +01:00
Tyeth Gundry
15ae874841
Merge branch 'adafruit:main' into add-potty-training 2025-06-10 23:51:24 +01:00
Liz
41de6c47e0
Merge pull request #3056 from adafruit/wiz5500
ethernet breakout examples
2025-06-10 16:24:49 -04:00
Liz
64f2cb5c31 ethernet breakout examples
adding circuitpython and arduino examples for the wiz5500 ethernet breakout
2025-06-10 16:10:31 -04:00
Tyeth Gundry
2c61160dbd
Add email template and WipperSnapper device config 2025-06-10 19:25:44 +01:00
Ha Thach
1be135c607
Merge pull request #3053 from adafruit/fix-sdfat-cardsize
replace cardSize() with sectorCount()
2025-06-09 13:58:56 +07:00
Liz
2b0f7263de
Merge pull request #3054 from adafruit/led_clock
updating matrix clock code
2025-06-06 13:02:55 -04:00
Liz
f3c46a4507 lint 2025-06-06 12:53:17 -04:00
Liz
5a8650418c fix pins for audio bff 2025-06-06 12:40:19 -04:00
Liz
f2ede9c176 adding extra features to matrix clock project
new features for matrix clock project
* "blinking eyes" every 30 seconds
* scrolling text during alarm
* scrolling text to denote if alarm is enabled
2025-06-06 12:39:18 -04:00
hathach
b793776adb
replace cardSize() with sectorCount()
also include SdFat_Adafruit_Fork.h instead of SdFat.h
2025-06-06 11:08:02 +07:00
Melissa LeBlanc-Williams
177ee7a9b8
Merge pull request #3052 from makermelissa/main
Fix many bugs
2025-06-04 15:07:47 -07:00
Melissa LeBlanc-Williams
f476d0a6c6 Fix many bugs 2025-06-04 14:34:54 -07:00
Mikey Sklar
07967a29c7
Merge pull request #3049 from adafruit/pi-hole-stats
Updates for Pi Hole 6.x release
New API from Pi Hole
Dropped API authentication
Mini PiTFT library changes
Pi OLED library changes
2025-06-04 12:10:22 -07:00
Mikey Sklar
5eff1adaa8 Update stats.py 2025-06-04 11:56:01 -07:00
Mikey Sklar
5cd01c6116 linting 2025-06-04 11:37:46 -07:00
Mikey Sklar
e5c40eb8ce Pi OLED updates
confirmed Pi OLED (SSD1306 I2C) works with new Pi Hole 6.x release code.
2025-06-04 11:13:02 -07:00
Mikey Sklar
9bea106029 increase font size 2025-06-04 09:13:46 -07:00
Mikey Sklar
339e0d7780 added extended SPDX 2025-06-04 08:52:11 -07:00
foamyguy
da3b838314 feather s2 bme280 deepsleep aio example 2025-06-03 12:26:46 -05:00
foamyguy
8d0262f1d7
Merge pull request #3050 from FoamyGuy/displayio_api_updates
displayio api updates
2025-06-03 08:41:40 -05:00
foamyguy
ed395b8276 displayio api updates 2025-06-02 16:05:23 -05:00
Mikey Sklar
8937ea355e linting long line. 2025-06-02 12:51:41 -07:00
Mikey Sklar
7a910ab962 pi-hole / bookworm / st7789 changes
A lot has changed since this guide was release.

The Pi Hole 6.x release in early 2025 dramatically changed the API.

Bookworm changes how some of the pins are used.

Even the ST7789 MiniPiTFT chip has some different options.

This code was tested and work with a MiniPiTFt on a Pi 4. I'd like to update the guide to support accommidate the software updates.
2025-06-02 12:43:59 -07:00
Liz
5df1fe038b
Merge pull request #3048 from adafruit/led_clock
update for led matrix clock
2025-06-02 09:56:03 -04:00
Liz
ec541811cc lint 2025-06-02 09:48:04 -04:00
Liz
95dbe2c665 update for led matrix clock
move audio playback call so that it isn't cut off and add a state to turn alarm functionality on/off
2025-06-02 09:43:36 -04:00
Limor "Ladyada" Fried
834f226528
Merge pull request #3047 from ladyada/rp2040_esppassthru
fix functionality for RP2x hosts
2025-06-02 09:22:08 -04:00
Limor "Ladyada" Fried
f3d3405272
Merge pull request #3044 from FoamyGuy/fix_sparkle_mini_warning
fix for sparkle motion mini warning
2025-06-01 15:27:30 -04:00
ladyada
bbd38c439e fix functionality for RP2x hosts 2025-06-01 15:21:50 -04:00
Liz
d2f16f8b7b
Merge pull request #3046 from adafruit/led_clock
adding led matrix clock code
2025-05-30 14:37:33 -04:00
Liz
02768500ad adding led matrix clock code
CircuitPython code and wav files for the led matrix clock project
2025-05-30 14:23:28 -04:00
Melissa LeBlanc-Williams
a87f6abb0b
Merge pull request #3045 from makermelissa/main
Add 3-in-a-row tile matching game
2025-05-29 14:46:54 -07:00
Melissa LeBlanc-Williams
08dc8367c5 Fix pylint issues 2025-05-29 14:43:32 -07:00
Melissa LeBlanc-Williams
d1c09dcd61 Merge branch 'main' of https://github.com/adafruit/Adafruit_Learning_System_Guides 2025-05-29 14:30:46 -07:00
Melissa LeBlanc-Williams
d70fa56444 Add 3-in-a-row tile matching game 2025-05-29 14:30:36 -07:00
foamyguy
fedcf13bd5 only test sparkle motion multi neopixels on esp32 2025-05-29 08:52:09 -05:00
foamyguy
63f3cc563a fix sparkle motion warning 2025-05-29 08:38:20 -05:00
foamyguy
7dba79be85 fix sparkle motion mini warning 2025-05-29 08:21:31 -05:00
Liz
b94d8a91fb
Merge pull request #3043 from adafruit/fix_wav_name
fix wav file name to match wav included in bundle
2025-05-28 16:23:47 -04:00
Liz
4445aa72a2 fix wav file name to match wav included in bundle 2025-05-28 15:52:22 -04:00
Liz
05c57a9690
Merge pull request #3041 from adafruit/mother_demo
mother of all demos code
2025-05-22 12:27:53 -04:00
Liz
c9f04bd6c5 mother of all demos code
CircuitPython code for the mother of all demos keyset project
2025-05-22 11:26:33 -04:00
Liz
50d5fe5980
Merge pull request #3040 from adafruit/ir_stick
adding ir remote example
2025-05-21 11:07:36 -04:00
BlitzCityDIY
114ab9a304 adding ir remote example
Adding IR remote Arduino example for the Sparkle Motion Stick
2025-05-21 10:51:16 -04:00
Liz
e503ce1e93
Merge pull request #3039 from FoamyGuy/sparklemotion_stick_arduino_i2smic
sparkle motion stick arduino i2s mic example
2025-05-21 10:08:23 -04:00
Liz
f3b75557cf
Merge pull request #3038 from adafruit/sparkle_stick
factory reset for sparkle motion stick
2025-05-21 10:07:57 -04:00
foamyguy
185cad9fad sparkle motion stick arduino i2s mic example 2025-05-20 16:39:09 -05:00
Liz
eb969fab97 factory reset for sparkle motion stick
adding factory reset for sparkle motion stick
2025-05-20 16:43:29 -04:00
foamyguy
0b7aa5dfcb
Merge pull request #3034 from FoamyGuy/tilepalettemapper_api_update
Tilepalettemapper api update
2025-05-20 09:36:49 -05:00
foamyguy
84b025b1e7 remove pylint disables and explcitly re-set hidden prop 2025-05-20 09:29:44 -05:00
foamyguy
7f89d19b5f add support for 9.x and 10.x tilepalettemapper API. 2025-05-20 09:09:52 -05:00
Tyeth Gundry
54ab01fead
Merge pull request #3028 from tyeth/iot-door-sensor-blockly
Add exported Magic config for IOT Door sensor
2025-05-14 22:33:56 +01:00
Tyeth Gundry
b71c26e514
Merge pull request #3037 from adafruit/update-schedules-io-guide
Update code.py
2025-05-14 22:33:06 +01:00
Tyeth Gundry
338447c6e7
Update code.py 2025-05-14 17:28:14 +01:00
Liz
11554113a0
Merge pull request #3036 from adafruit/toy_xylo
adding code and midi files
2025-05-13 16:57:37 -04:00
Liz
531c15cd5f lint 2025-05-13 16:51:19 -04:00
Liz
d1f5eac58e adding code and midi files
Adding code and midi files for the toy robot xylophone project.
2025-05-13 16:47:19 -04:00
Anne Barela
7765812f24
Add files via upload 2025-05-12 15:05:58 -04:00
Liz
2ab43f179b
Merge pull request #3035 from adafruit/motor_slider
add gerber files for camera slider pcb
2025-05-12 12:20:16 -04:00
Liz
f82ee27e21 add gerber files for pcb 2025-05-12 11:11:11 -04:00
Melissa LeBlanc-Williams
508815e216
Merge pull request #3032 from makermelissa/main
Minesweeper improvements
2025-05-11 11:06:19 -07:00
foamyguy
8d7141d02e update mapping after create tilegrid 2025-05-10 09:34:36 -05:00
foamyguy
f56a6fb93f update tilepalettemapper usage for new API 2025-05-10 09:32:34 -05:00
John Edgar Park
f5041994ab
Merge pull request #3033 from jedgarpark/larsio-music
LPM for Fruit Jam and Metro RP2350
2025-05-09 17:09:15 -07:00
jedgarpark
565f1299d6 even more pylint 2025-05-09 15:03:15 -07:00
jedgarpark
5efae78d0c moar pylint 2025-05-09 13:27:56 -07:00
jedgarpark
208b435e98 LPM for Fruit Jam and Metro RP2350 2025-05-09 09:56:34 -07:00
foamyguy
9895057dd5 adding some icons and metadata for fruitjam os, request display size in some metro rp2350/fruitjam apps 2025-05-09 10:16:58 -05:00
Melissa LeBlanc-Williams
a30d244cf1 Remove more debug prints 2025-05-08 13:16:51 -07:00
Melissa LeBlanc-Williams
e467423fac Fix menu color when mouse is over 2025-05-08 13:12:58 -07:00
Melissa LeBlanc-Williams
f295b8b34d Remove debug message 2025-05-08 12:32:32 -07:00
Melissa LeBlanc-Williams
af5efebe65 Remove unused items 2025-05-08 12:18:44 -07:00
Melissa LeBlanc-Williams
afa65ff360 Minesweeper improvements 2025-05-08 12:16:14 -07:00
Anne Barela
c5bec455de
Merge pull request #3031 from adafruit/TheKitty-patch-7
Update code.py
2025-05-06 12:45:52 -04:00
Anne Barela
a9485dfec3
Update code.py 2025-05-06 12:42:50 -04:00
Anne Barela
5ac268249b
Update code.py 2025-05-06 12:38:37 -04:00
Anne Barela
26d640d90e
Create code.py 2025-05-06 12:37:28 -04:00
Anne Barela
65e75e579f
Create README.md 2025-05-06 12:36:43 -04:00
Liz
c65bf173de
Merge pull request #3030 from adafruit/motor_slider
tidy up schematic
2025-05-06 09:53:32 -04:00
Liz
a92dde9884 tidy up schematic
clean up schematic for the motor slider learn guide
2025-05-06 08:42:52 -04:00
Liz
3cba541938
Merge pull request #3029 from adafruit/motor_slider
TMC2209 camera slider project
2025-05-05 16:48:53 -04:00
Liz
e734c9c961 lint lint 2025-05-05 16:15:23 -04:00
Liz
65842cdb9b lint 2025-05-05 16:10:02 -04:00
Liz
a177c59bcc final code and PCM files 2025-05-05 16:05:15 -04:00
Tyeth Gundry
520f77ef0d
Add exported Magic config for IOT Door sensor
https://learn.adafruit.com/iot-open-door-detector-using-notifications-with-adafruit-io
2025-05-02 18:13:34 +01:00
John Edgar Park
74314751a8
Merge pull request #3027 from jedgarpark/computer-space
first commit Computer Space attract
2025-04-30 12:02:25 -07:00
jedgarpark
198469c7f6 added SSD1305 library to library.deps 2025-04-30 10:50:37 -07:00
jedgarpark
d44d654d39 first commit Computer Space attract 2025-04-30 10:21:18 -07:00
Scott Shawcroft
37afebbd3f
Merge pull request #3025 from FoamyGuy/usb_host_mouse
Usb host mouse examples
2025-04-24 11:43:02 -07:00
foamyguy
4b8feb23bc fix some reference to mice in the keyboard example 2025-04-24 13:18:34 -05:00
foamyguy
822de1266e Merge branch 'refs/heads/main' into usb_host_mouse 2025-04-24 13:16:33 -05:00
Liz
f5d4123a0b miso/mosi rev b 2025-04-24 10:36:08 -04:00
foamyguy
7d22755433
Merge pull request #3026 from FoamyGuy/usb_host_keyboard_examples
usb host keyboard examples
2025-04-24 08:07:13 -05:00
foamyguy
7622520b69 pylint disable too-many-function-args 2025-04-23 17:53:47 -05:00
Liz
7ca93c2a8e miso/mosi 2025-04-23 16:01:29 -04:00
foamyguy
b8d94ec2db use tinyusb feather testonly 2025-04-23 15:00:22 -05:00
foamyguy
9010f17295 fix SPDX 2025-04-23 14:50:06 -05:00
foamyguy
c300a38e95 usb host keyboard examples 2025-04-23 14:44:55 -05:00
foamyguy
fb4eee8158 arduino usb host mouse examples 2025-04-22 12:34:43 -05:00
foamyguy
b666b57c4a higher timeout value 2025-04-22 10:23:46 -05:00
foamyguy
024885ed60 displayio cursor mouse circuitpython example 2025-04-22 09:42:11 -05:00
foamyguy
b8f605855c basic mouse circuitpython example 2025-04-21 17:06:53 -05:00
foamyguy
5fe76b9b3a
Merge pull request #3024 from FoamyGuy/usbhost_snespad_arduino_2
add support for Metro rp2350 USB SNES-like controller
2025-04-17 19:55:19 -05:00
foamyguy
c056b4e249 remove references to different cores 2025-04-17 16:13:17 -05:00
foamyguy
74a8f9c1c5 try to fix metro .test.only file 2025-04-17 15:27:54 -05:00
foamyguy
3378ed902d give each device their own .test.only file 2025-04-17 15:06:47 -05:00
Liz
4ffdcba741 minor nudging 2025-04-17 15:54:59 -04:00
foamyguy
74b401d622 add support for Metro rp2350, remove unused usb hid device handling, remove device name from folder. 2025-04-17 14:53:51 -05:00
Liz
9cc428580a move label 2025-04-17 15:47:16 -04:00
Liz
9288b996c4 rev b 2025-04-17 15:46:43 -04:00
foamyguy
3f0ed86c37
Merge pull request #3023 from FoamyGuy/usbhost_snespad_arduino
USB SNES-like controller example for arduino
2025-04-17 13:44:56 -05:00
foamyguy
f91a3e6b52 use usbhost tinyusb config 2025-04-17 12:42:13 -05:00
foamyguy
6a9015c68e remove CPU freq restriction. move into subfolder that arduino ide wants. 2025-04-17 12:30:38 -05:00
foamyguy
da43407a16 fix typo, add test.only file, add device to folder name to prepare for metro version 2025-04-17 12:21:17 -05:00
foamyguy
7edbbf2401 remove dupe file extension 2025-04-17 11:52:48 -05:00
foamyguy
42ecec6928 USB SNES-like controller example for arduino 2025-04-17 11:50:08 -05:00
foamyguy
3eaa064690
Merge pull request #3016 from justmobilize/secrets-cleanup-q-w
Secrets Cleanup Q-W
2025-04-16 12:39:29 -05:00
Melissa LeBlanc-Williams
b415616277
Merge pull request #3022 from makermelissa/main
Adding Minesweeper code for new guide
2025-04-16 10:12:07 -07:00
Melissa LeBlanc-Williams
00d5e27de7 Fix pylint false positive 2025-04-16 00:23:47 -07:00
Melissa LeBlanc-Williams
5cc6a257d3 Remove relative imports 2025-04-16 00:14:40 -07:00
Melissa LeBlanc-Williams
87c04e1c46 Merge branch 'main' of https://github.com/adafruit/Adafruit_Learning_System_Guides 2025-04-16 00:14:00 -07:00
Melissa LeBlanc-Williams
0cb30f6996 Fix pylint issues 2025-04-16 00:13:05 -07:00
Melissa LeBlanc-Williams
e94ba7e31f Fix bugs introduced by pylint 2025-04-16 00:09:44 -07:00
Melissa LeBlanc-Williams
58e89f5b6e Add minesweeper code 2025-04-16 00:03:32 -07:00
Liz
eca663c40c
Merge pull request #3021 from adafruit/solenoid_i2c
adding 8 channel solenoid driver demos
2025-04-15 16:34:28 -04:00
Liz
f8cb964c21 Create .uno.test.only 2025-04-15 15:24:21 -04:00
Liz
8140f4286e adding 8 channel solenoid driver demos 2025-04-15 15:15:32 -04:00
foamyguy
ef00664e14
Merge pull request #3014 from justmobilize/secrets-cleanup-p-part2
Secrets Cleanup: P Part 2
2025-04-15 10:17:18 -05:00
Brent Rubell
86686fa817
Merge pull request #3020 from brentru/update-ws-offline-config-file
Update - WS Offline Guide
2025-04-14 14:38:39 -04:00
brentru
c64dfdc9c3 update config.json from autoconfig'd board 2025-04-14 14:07:41 -04:00
Liz
6bce301f25
Merge pull request #3018 from casten/patch-2
Detect max quality level dynamically.
2025-04-14 08:55:55 -04:00
Liz
8d0ef9d35a
Merge branch 'main' into patch-2 2025-04-14 08:51:54 -04:00
Liz
c9b7193a22
Merge pull request #3017 from casten/patch-1
fix incompatibility with ov5640 and Pico
2025-04-14 08:46:11 -04:00
Liz
8b940c95db
Merge pull request #3012 from monkz0390/patch-1
Dark Moon support, code.py
2025-04-14 08:43:53 -04:00
Casten Riepling
b49083177b Tighten up allocation excaption catching 2025-04-12 20:52:39 +00:00
Casten Riepling
3357fefbb0 fix lint error 2025-04-11 22:51:53 +00:00
foamyguy
dceed82785
Merge pull request #3019 from FoamyGuy/metro_match3_game
Metro match3 game
2025-04-11 14:23:00 -05:00
foamyguy
0332716490 button bitmaps 2025-04-11 13:50:14 -05:00
foamyguy
f4d0dc75c2 pylint fixes, add title card 2025-04-11 13:42:30 -05:00
foamyguy
f7e6c1fb3e a few more comments 2025-04-11 13:18:15 -05:00
Casten Riepling
6a9407744a
Detect max quality level dynamically.
Detect max quality level dynamically.
This will select 2 for standard Pico 2's and 5 for standard Pico's.
2025-04-10 22:31:49 -07:00
Casten Riepling
70d15e1284
fix incompatibility with ov5640 and Pico
Changes to Adafruit_CircuitPython_OV5640 doubled the memory usage for a given quality setting.  This makes the latest release of in CircuitPython incompatible with the previous quality setting=3
 + colorspace=adafruit_ov5640.OV5640_COLOR_JPEG due to that working out an an allocation size of 204800.  This is too much for the first Pico.
Here is the breaking change:
https://github.com/adafruit/Adafruit_CircuitPython_OV5640/pull/35
Quality 4 is still too large at 153,600 bytes.
Quality 5 using 122,880 works.
2025-04-10 21:17:23 -07:00
foamyguy
166852bff0 match3 game code 2025-04-10 17:13:45 -05:00
foamyguy
b7abaf52ee autosave and resume demo 2025-04-10 15:42:55 -05:00
Justin Myers
2642e48856 Secrets Cleanup Q-W 2025-04-10 10:27:40 -07:00
foamyguy
f94718eb4d
Merge pull request #3015 from FoamyGuy/usb_snespad_circuitpython
adding circuitpython example for USB Host with SNES like gamepad
2025-04-10 11:38:34 -05:00
foamyguy
0ad935f655 remove comment references to non-existent variable. 2025-04-10 10:30:19 -05:00
foamyguy
0f450b0718 remove unused section. Comment out raw data print. 2025-04-10 10:23:35 -05:00
foamyguy
5239baffaf adding circuitpython example for USB Host with SNES like gamepad 2025-04-10 10:16:37 -05:00
foamyguy
ded8d0098e tilepallettemapper demo code 2025-04-10 10:10:45 -05:00
Henry Amador
b2a98fe698
Update code.py
fixing pylint error
inconsistent use of tabs and spaces in indentation
corrected by removing tabs and indenting with spaces
2025-04-09 15:25:01 -07:00
Justin Myers
f9a414ddbc Secrets Cleanup: P Part 2
- fix typos celcius to celsius
2025-04-09 11:14:47 -07:00
Justin Myers
2b5fd71ab0 Secrets Cleanup: P Part 2 2025-04-09 10:16:06 -07:00
foamyguy
071c95b5b7
Merge pull request #3004 from justmobilize/secrets-cleanup-p-part1
Secrets Cleanup: P Part 1
2025-04-09 11:27:13 -05:00
foamyguy
fb932a96ec refactor rsa private key to its own file in gcpiot. add aio name and key to placeholder settings.toml for halloween countdown. 2025-04-09 11:21:53 -05:00
foamyguy
76d2a5ae21 two mice code 2025-04-09 11:17:50 -05:00
Melissa LeBlanc-Williams
389027c9aa
Merge pull request #3011 from makermelissa/main
Bug fixes for Chips Challenge
2025-04-08 16:09:40 -07:00
Melissa LeBlanc-Williams
de887d18ea Last minute bug fixes 2025-04-08 16:06:27 -07:00
Justin Myers
06fcc8e04c Secrets Cleanup: P Part 1
- fix PyPortal_CMA_Art_Frame
2025-04-08 11:13:48 -07:00
Henry Amador
e05e3f928d
Dark Moon support, code.py
Added Dark Moon support when i noticed the moon didn't update on a dark moon night.
Added Red Moon as error indicator if there is another instance of API responding with something unexpected
2025-04-07 21:01:18 -07:00
Melissa LeBlanc-Williams
7c19748b1b Fix dialog bug 2025-04-07 18:12:27 -07:00
Melissa LeBlanc-Williams
2ded43760f Add missing sound file 2025-04-07 16:54:46 -07:00
Melissa LeBlanc-Williams
a5dbc3958d Bug fixes for Chips Challenge 2025-04-07 15:10:09 -07:00
Liz
608253e0c8
Merge pull request #3010 from adafruit/asteroid
adding asteroid code and assets
2025-04-07 15:19:29 -04:00
Liz
a38cbfb13d adding asteroid code and assets 2025-04-07 15:14:31 -04:00
Liz
b2371f2585 switch jst xh connectors 2025-04-03 18:22:22 -04:00
Liz
72517cf5cd Update TMC2209_Camera_Slider_PCB.brd 2025-04-03 17:43:15 -04:00
Liz
564f99c7fb emojis 2025-04-03 17:12:59 -04:00
foamyguy
c16e76efa1
Merge pull request #3009 from FoamyGuy/memory_game
fix typo's and other comment updates memory game
2025-04-03 14:14:12 -05:00
foamyguy
ec671a3ece fix typo's and other comment updates 2025-04-03 14:06:26 -05:00
BlitzCityDIY
0c2b9353a1 silkscreen labels 2025-04-03 11:42:39 -04:00
BlitzCityDIY
05b30667d5 adding eagle files, initial routing 2025-04-03 11:14:30 -04:00
Liz
2f156c65bc
Merge pull request #3003 from adafruit/tlv320
TLV320 arduino and cp examples
2025-04-02 14:45:18 -04:00
Melissa LeBlanc-Williams
94ce0330c9
Merge pull request #3007 from makermelissa/main
Add Chips Challenge for guide
2025-04-02 11:18:32 -07:00
Tyeth Gundry
dc254f08db
Merge pull request #3008 from tyeth/Plotting_Offline_Data
Add assets for Plotting Offline Data guide
2025-04-02 16:17:10 +01:00
Tyeth Gundry
0107361db8
Add assets for Plotting Offline Data guide 2025-04-02 16:13:04 +01:00
Melissa LeBlanc-Williams
1f143abc19 Remove TODO 2025-04-01 18:06:48 -07:00
Melissa LeBlanc-Williams
c604b5d4ee more linting 2025-04-01 17:00:51 -07:00
Melissa LeBlanc-Williams
1e76acf211 linting 2025-04-01 16:54:48 -07:00
Melissa LeBlanc-Williams
b4a7cf88bb Add Chips Challenge for guide 2025-04-01 16:12:51 -07:00
Brent Rubell
d2abcbff2e
Merge pull request #3006 from brentru/fix-stepper-guide
Fix - Adafruit IO Stepper Control Guide
2025-04-01 13:59:11 -04:00
brentru
3548bd13a4 isalive->is_alive 2025-04-01 12:54:45 -04:00
Brent Rubell
83809937b1
Merge pull request #3005 from brentru/update-matrixportal-scroll-guide
Update Matrix Portal New Guide Scroller Code.py
2025-04-01 12:22:07 -04:00
brentru
aeaceaef7c Use new API and key 2025-04-01 12:14:27 -04:00
Justin Myers
f23741077e Secrets Cleanup: P Part 1 2025-04-01 07:07:01 -07:00
Liz
bd8b9de5e6 tinyusb test 2025-04-01 08:34:24 -04:00
Liz
8636c1f1f2 retest 2025-04-01 08:27:04 -04:00
Liz
371f7a40a9 Update TLV320_Tone_Arduino.ino 2025-03-31 16:45:14 -04:00
foamyguy
ef9f2cc230
Merge pull request #3001 from justmobilize/secrets-cleanup-l-o
Secrets Cleanup: L, M and O
2025-03-31 15:42:22 -05:00
Liz
5a20f1cd72 TLV320 arduino and cp examples
Examples for the TLV320DAC3100 breakout guide
2025-03-31 16:41:55 -04:00
Liz
923b6f24ce
Merge pull request #3002 from adafruit/esp32_ci
bring back esp32 test for usb host max breakout
2025-03-26 17:53:48 -04:00
Liz
f037a7b937 bring back esp32 test for usb host max breakout
Adding back the esp32 test for usb host bff code (library was released yesterday). Adding a minor comment to the code to trigger Arduino CI
2025-03-26 16:04:05 -04:00
Liz
65ced5837c
Merge pull request #2977 from Technik-Tueftler/202502_fix_receive_error
When creating feeds, also add the first value
2025-03-26 15:59:13 -04:00
foamyguy
06dded0371
Merge pull request #2994 from FoamyGuy/memory_game
memory game files
2025-03-25 13:32:51 -05:00
Justin Myers
592b33be07 Secrets Cleanup: L, M and O 2025-03-25 07:49:30 -07:00
Liz
53234f9932
Merge pull request #2999 from adafruit/max_usb
remove esp32 test until tinyusb release
2025-03-25 09:54:48 -04:00
foamyguy
bedfa656d8
Merge pull request #2995 from justmobilize/secrets-cleanup-f-i
Secrets Cleanup: F and I
2025-03-25 08:50:01 -05:00
Liz
9859b44e07 remove esp32 test until tinyusb release
swapping esp32 tests for usb host bff arduino examples to none until tinyusb has a new release since it's been causing confusion
2025-03-25 08:37:26 -04:00
Liz
7406a2bb4a
Merge pull request #2978 from jepler/runcpm-metro-rp2350
Port RunCPM to the Metro RP2350 with HSTX
2025-03-25 08:33:24 -04:00
Liz
81fa01f589
Merge pull request #2996 from caternuson/drv8833_examples
Add DRV8833 code examples
2025-03-24 19:46:44 -04:00
Liz
2c78e713b5 Update Feather_RP2040_Adalogger.ino 2025-03-24 19:37:39 -04:00
7f6f1627b8 undo unintended change to original rp2040 sketch 2025-03-24 17:28:52 -05:00
72b8e9743f Merge remote-tracking branch 'origin/main' into runcpm-metro-rp2350 2025-03-24 14:49:32 -05:00
6b9d4d87dc Fix selecting right SPI instance on Metro RP2350
& stop hard-coding the CS pin
2025-03-24 14:04:52 -05:00
Limor "Ladyada" Fried
f327f68eb6
Merge pull request #2998 from jepler/jammy-matrix
into the jammy matrix
2025-03-24 14:40:08 -04:00
foamyguy
6c91cac0aa
Merge pull request #2997 from FoamyGuy/circuitpython_matrix
circuitpython matrix implementation
2025-03-24 13:32:44 -05:00
foamyguy
b38e2c29e3 pylint ignore imports outside top-level to avoid imports in environments that wont need them due to built-in display. 2025-03-24 13:07:14 -05:00
9ebf8bc0e3 only build on metro rp2350 for now 2025-03-24 13:04:20 -05:00
foamyguy
4f9be49545 use built-in display if it exists and is initialized. 2025-03-24 12:55:26 -05:00
cf2f2b01ff into the jammy matrix 2025-03-24 11:23:09 -05:00
foamyguy
c45d70e536 circuitpython matrix implementation 2025-03-23 10:51:16 -05:00
Liz
24261aa88e remove sdfat, use sdfat fork in testbed
importing sdfat along with testbed was causing conflicts since it was importing both sdfat from rp2040 and sdfat - adafruit fork from testbed
2025-03-20 19:14:11 -04:00
Liz
9dce1e3e2b try adding esp32 ble audio libraries 2025-03-20 16:54:51 -04:00
caternuson
75c5023819 uno test only 2025-03-20 10:21:41 -07:00
caternuson
9a5c2e37f4 adding DRV8833 code examples 2025-03-20 10:08:57 -07:00
Justin Myers
906e10e481 Secrets Cleanup: F and I 2025-03-19 16:24:53 -07:00
foamyguy
e4aac8bdbb
Merge pull request #2991 from justmobilize/secrets-cleanup-c-e
Secrets Cleanup: C and E
2025-03-19 10:51:10 -05:00
foamyguy
77710f445d memory game files inital commit 2025-03-18 17:03:43 -05:00
Justin Myers
02d49a92e7 Secrets Cleanup: C and E - change wave updates, remove pylint comment too new 2025-03-14 12:43:20 -07:00
Justin Myers
1082a37124 Secrets Cleanup: C and E - change wave updates 2025-03-14 11:52:49 -07:00
Anne Barela
05ca129522
Merge pull request #2993 from FoamyGuy/metro_rp2350_snakegame
Update snake game key inputs
2025-03-14 10:45:09 -04:00
foamyguy
2baf7aaa86 case-insensitive rest of the keys, and support uppercase binding values 2025-03-14 09:38:15 -05:00
foamyguy
96fa902545 case-insensitive key inputs 2025-03-14 09:25:05 -05:00
foamyguy
1bebd9ad51
Merge pull request #2992 from FoamyGuy/metro_rp2350_snakegame
Metro rp2350 snake game
2025-03-13 14:38:55 -05:00
foamyguy
e346383916 change order of condition. remove init function from custom exception. 2025-03-13 14:29:05 -05:00
foamyguy
a2e7224702 update display init for current released version 2025-03-13 13:53:23 -05:00
foamyguy
2e54a0214d metro rp2350 snake game 2025-03-13 13:46:33 -05:00
Justin Myers
25db1babaa Secrets Cleanup: C and E 2025-03-12 14:58:28 -07:00
foamyguy
c322fbd036
Merge pull request #2989 from justmobilize/secrets-cleanup-a
Secrets Cleanup: A
2025-03-12 15:56:21 -05:00
Anne Barela
f7041992ce
Merge pull request #2990 from adafruit/moon_phase
adding moon phase clock & bluetooth speaker
2025-03-11 16:35:35 -04:00
Liz
a326077b38 Update Bluetooth_Lumon_Speaker.ino 2025-03-11 15:55:22 -04:00
Liz
1e54149f1a adding moon phase clock & bluetooth speaker
CircuitPython code for moon phase clock and arduino code for bluetooth lumon speaker
2025-03-11 15:53:43 -04:00
Justin Myers
76045d0558 Secrets Cleanup: A 2025-03-07 13:19:44 -08:00
foamyguy
a216a61a40
Merge pull request #2988 from FoamyGuy/flappy_nyan_cat
Flappy nyan cat game
2025-03-07 10:19:57 -06:00
foamyguy
0077f024ee top level about game comment & controls. 2025-03-07 10:02:00 -06:00
foamyguy
8f0f5ef420 add gameover and play again functionality. add license. 2025-03-07 09:54:03 -06:00
foamyguy
6f3542c9a3 adding flappy nyan cat game 2025-03-06 20:11:10 -06:00
Liz
1ae1defb25
Merge pull request #2987 from adafruit/pcm510x_examples
PCM510x CP and Arduino examples
2025-03-05 17:31:41 -05:00
Liz
721b62dda9 arduino examples 2025-03-05 16:46:08 -05:00
Liz
636ec27ada circuitpython demos for PCM510x
wav and tone demos for PCM510x I2S DAC
2025-03-05 16:18:50 -05:00
Dan Halbert
a11851d35a
Merge pull request #2986 from adafruit/TheKitty-patch-7
Rename .none.test.only to .metro_rp2350.test.only
2025-03-04 19:47:11 -05:00
Anne Barela
6b4cece80e
Rename .metro_rp2350.test.only to .none.test.only
Still a dependency issue
2025-03-04 18:45:53 -05:00
Anne Barela
549f248817
Update library.deps 2025-03-04 18:34:10 -05:00
Anne Barela
c1b20c7f13
Update README.md 2025-03-04 18:33:07 -05:00
Anne Barela
1b0e08a316
Update Metro_HSTX_Matrix.ino 2025-03-04 18:19:49 -05:00
Anne Barela
82f6997347
Update library.deps
Add new Adafruit DVI HSTX library
2025-03-04 18:16:34 -05:00
Anne Barela
6827024509
Update Metro_HSTX_Matrix.ino
Change from 40% to 65%
2025-03-04 18:06:44 -05:00
Anne Barela
68aec70f4a
Rename .none.test.only to .metro_rp2350.test.only 2025-03-04 18:05:14 -05:00
Anne Barela
15b4cc768b
Tweak label 2025-03-04 12:16:47 -05:00
Anne Barela
9d5ec334d1
Merge pull request #2985 from adafruit/TheKitty-patch-7
Update matrix.ino
2025-03-02 20:34:38 -05:00
Anne Barela
b287f01401
Rename .metro_rp2350.test.only to .none.test.only
The program uses changes to the Adafruit-DVI-HSTX library not yet pushed to Arduino to skip check until that is corrected
2025-03-02 20:02:25 -05:00
Anne Barela
e831125ec9
Rename matrix.ino to Metro_HSTX_Matrix.ino
Satisfy linter
2025-03-02 19:53:41 -05:00
Anne Barela
0d6babcecc
Rename .metrorp2350.test.only to .metro_rp2350.test.only 2025-03-02 19:37:40 -05:00
Anne Barela
cd29c39cf4
Update matrix.ino 2025-03-02 19:30:43 -05:00
Anne Barela
9836040c2b
Add Adafruit Metro RP2350 DVI Matrix code 2025-03-02 19:29:41 -05:00
Anne Barela
86866a45d0
Create .metrorp2350.test.only 2025-03-02 19:28:10 -05:00
Liz
10c616e797
Merge pull request #2984 from adafruit/mdr_terminal
adding severance terminal code
2025-02-28 22:59:33 -05:00
Liz
20ee088f11 rework get_username 2025-02-28 20:01:49 -05:00
Liz
5d759b5fb8 lint 2025-02-28 19:56:02 -05:00
Liz
0ad7f62f82 fix broad except 2025-02-28 19:51:01 -05:00
Liz
9f557683eb adding severance terminal code
main file - lumon.py
subclasses - palette.py, data_bin.py and data.py
images - lumon-logo and lumon-logo-small
mdr.service - systemd file to run on boot
2025-02-28 19:46:51 -05:00
Anne Barela
06d7ef1381
Merge pull request #2983 from adafruit/TheKitty-patch-7
Submit code for Metro RP2350 Breakout
2025-02-28 11:27:58 -05:00
Anne Barela
8e27ae82bd
Judicious pylint statements 2025-02-28 11:24:23 -05:00
Anne Barela
8c7957bc3f
Eliminate white space, scope variables, in 2025-02-28 10:42:21 -05:00
Anne Barela
8327a4e941
Update code.py 2025-02-28 10:24:53 -05:00
Anne Barela
831e2736e4
Submit code for Metro RP2350 Breakout
New Learn guide
2025-02-28 10:11:07 -05:00
55eff111ad follow upstream rename of this class 2025-02-27 14:38:41 -06:00
Liz
82a6e55c06
Merge pull request #2981 from adafruit/sparkle_motion_factory
adding factory reset for sparkle motion
2025-02-27 15:24:05 -05:00
Brent Rubell
69502c1caa
Merge pull request #2982 from brentru/add-ws-offline-guide
Add: WipperSnapper Offline Guide Resources
2025-02-27 14:11:40 -06:00
Liz
af36141979 RDM files required, change import to local instead of /libraries 2025-02-27 15:10:41 -05:00
brentru
ed8ea8d82c Add offline file 2025-02-27 15:04:42 -05:00
Liz
16c13435ec add headers to dmx
each example requires the header files since they are in different directories
2025-02-27 14:49:25 -05:00
Liz
8282ba3d45 adding factory reset for sparkle motion 2025-02-27 14:20:56 -05:00
Liz
7681d5b70a
Merge pull request #2980 from adafruit/dmx_cleanup
removing individual .test.skip files from DMX NeoPixels
2025-02-26 17:32:26 -05:00
Liz
7b2a3ba12a removing individual .test.skip files
chatted with JP - these examples should be tested against the uno. removing all of the individual board test.skip files from each example folder
2025-02-25 18:27:09 -05:00
Anne Barela
67a2acbbcd
Merge pull request #2979 from FoamyGuy/qtpy_rounddisplay_compass
addding qtpy s2 round display compass
2025-02-25 17:21:35 -05:00
foamyguy
f32c65db2c fix imports 2025-02-25 16:12:38 -06:00
foamyguy
069a57e1b4 add qtpy s2 round display compass 2025-02-25 16:06:34 -06:00
Anne Barela
726d0057f9
Update gemma_main.py
Add SPDX
2025-02-25 11:34:18 -05:00
Anne Barela
c77cc96973
Create gemma_main.py 2025-02-25 11:06:28 -05:00
Anne Barela
5a4c1ced91 Remove moved Matrix Portal projects
All these projects were duplicated into the Matrix_Portal subdirectory. The guides were all edited to point to the new code. Removing these gets rid of the duplicates and frees up space in the main repo which is the main goal of this task.
2025-02-24 17:17:48 -06:00
Anne Barela
add7fcd7d2 Rename Directory
The guide editors don't seem to like directories with spaces in them. Change to underline.
2025-02-24 16:32:55 -06:00
Anne Barela
269d72e4b5 Make Matrix Portal Subdirectory
Make a new Matrix Portal subdirectory and copy Matrix Portal guides in. Then guides will be pointed to the new repo copies and the old ones deleted in the main repo to make more room.
2025-02-24 16:21:23 -06:00
Anne Barela
75fe6a4047 Move one more CLUE project
Move one more CLUE project to the new CLUE subdirectory
2025-02-24 14:56:06 -06:00
Anne Barela
fde91334de Merge branch 'main' of https://github.com/adafruit/Adafruit_Learning_System_Guides 2025-02-24 14:25:12 -06:00
Anne Barela
0a8de560b8 Remove duplicate CLUE Repos
All CLUE repos deleted have been moved to the CLUE subdirectory. The associated guides have been changed to point to the new code.

There may be a  few CLUE projects which still need moving. These are all confirmed.
2025-02-24 14:24:58 -06:00
a5cee34e60 make it start on fruitjam, no usb love 2025-02-24 14:22:01 -06:00
cb76498965 put headers back in required order 2025-02-24 14:21:50 -06:00
Anne Barela
abe0acb3e7
Update README.md 2025-02-24 15:16:50 -05:00
Anne Barela
dc43693f17 Copy CLUE projects to new CLUE subdirectory
To "clean up" the Learn System repo, we need to move groups of guides into subdirectories. This PR duplicates the CLUE guides into the CLUE subdirectory so guides may be changed prior to deleting redundant project repos to make more space.
2025-02-24 11:21:29 -06:00
Anne Barela
0e17763a29
Update README.md
Add README to new CLUE directory
2025-02-24 12:13:29 -05:00
Anne Barela
aa2361d439
Create README.md 2025-02-24 12:12:31 -05:00
5a0e281ade CI the right board 2025-02-24 10:33:16 -06:00
4151751dd7 Port RunCPM to the Metro RP2350 with HSTX
This uses the built in HSTX connector for video out, and the built in SD card for file storage.
It's a 1-board emulator for the 8-bit CP/M operating system!

At this time, unreleased modifications to Adafruit_dvhstx and Pico-PIO-USB are needed. Otherwise,
the code will not work properly.
2025-02-24 10:32:02 -06:00
a6851c595e checkpoint: keyboard copro code works -ish with dvhstx text mode 2025-02-24 09:54:45 -06:00
Technik Tüftler
b35069b3a9 expanding the comments for better understanding 2025-02-19 21:58:23 +01:00
Technik Tüftler
02ccc6c1a2 When creating feeds, also add the first value 2025-02-19 21:43:34 +01:00
Anne Barela
f356fba7d8
Merge pull request #2974 from jedgarpark/midi-host2host
first commit USB MIDI Host2Host
2025-02-19 14:36:49 -05:00
Anne Barela
bbaa4f5fbc
Merge pull request #2975 from adafruit/rp2350_ci
add rp2350 boards to arduino ci
2025-02-19 13:00:09 -05:00
Liz
70a7ca66e1 rename microsd folder 2025-02-19 12:42:13 -05:00
Liz
d9dd6f38d0 adding none.test.only to dmx project 2025-02-19 12:28:52 -05:00
Anne Barela
1554ea417e
Merge pull request #2976 from FoamyGuy/usb_host_gamepad
USB Host gamepad read data example
2025-02-19 10:07:30 -05:00
foamyguy
d8166ffec5 rename inner for loop vars 2025-02-19 08:59:54 -06:00
foamyguy
ced0b7a139 USB Host gamepad read data example 2025-02-19 08:47:15 -06:00
Liz
fc4e738f28 add rp2350 boards to arduino ci 2025-02-19 09:35:35 -05:00
jedgarpark
f521981f48 first commit USB MIDI Host2Host 2025-02-18 20:59:08 -08:00
foamyguy
547a3315e6
Merge pull request #2973 from FoamyGuy/metro2350
Arduino SD Card example
2025-02-18 17:35:28 -06:00
foamyguy
dc7aaf2397 disable test 2025-02-18 16:59:45 -06:00
foamyguy
602ac644c3 Arduino SD Card example 2025-02-18 16:45:58 -06:00
Anne Barela
7cc05f27f4
Merge pull request #2972 from FoamyGuy/metro2350
adding HSTX example for Metro RP2350
2025-02-18 17:10:27 -05:00
foamyguy
8b720619f8 adding HSTX example for Metro RP2350 2025-02-18 16:00:00 -06:00
Liz
1ae44de44f
Merge pull request #2971 from adafruit/pico_w_update
adding error handling for settings.toml
2025-02-18 12:32:59 -05:00
Liz
fc71e49d78 adding error handling for settings.toml
Adding error handling for settings.toml to pico w wifi examples. if a settings.toml entry is not found/incorrect then a type error is raised but it isn't very descriptive, especially for beginners
2025-02-18 12:25:01 -05:00
foamyguy
d110742ba9
Merge pull request #2970 from FoamyGuy/metro2350
CircuitPythonMetro2350 Examples
2025-02-18 10:12:04 -06:00
foamyguy
3e33418828 eol newlines 2025-02-18 09:22:49 -06:00
foamyguy
4135617fea metro rp2350 examples 2025-02-18 09:21:38 -06:00
foamyguy
18a037deef
Merge pull request #2755 from FoamyGuy/displayio_api_9x
Displayio api 9x
2025-02-14 16:14:39 -06:00
foamyguy
52416a25f2 more 9.x displayio changes 2025-02-14 15:49:29 -06:00
foamyguy
f1cf3ce157 Merge branch 'refs/heads/main' into displayio_api_9x 2025-02-14 15:07:28 -06:00
Anne Barela
109eebcb0f
Merge pull request #2969 from jedgarpark/espresso-water
updated espresso code to power down sensor
2025-02-12 16:30:50 -05:00
jedgarpark
d64251b18a pylint fixes 2025-02-12 12:48:06 -08:00
jedgarpark
93c450259a updated espresso code to power down sensor 2025-02-12 12:34:24 -08:00
Anne Barela
e5757ccc0d
Merge pull request #2968 from FoamyGuy/adding_cartoon_clock
adding song files
2025-02-12 12:16:40 -05:00
foamyguy
802e54a0b5 adding song files 2025-02-12 10:08:27 -06:00
foamyguy
ce98c5ee8d
Merge pull request #2967 from FoamyGuy/adding_cartoon_clock
adding cartoon character clock
2025-02-11 15:00:39 -06:00
foamyguy
4eff77cd4e remove pylint configs from newer version 2025-02-11 14:49:38 -06:00
foamyguy
9c845aa13e re-arrange imports. disable pylint configs 2025-02-11 13:45:39 -06:00
foamyguy
3b1855030f adding cartoon character clock 2025-02-11 13:24:59 -06:00
Liz
8dab4866d0
Merge pull request #2965 from adafruit/round_display
demo code for the gc9a01a round display
2025-02-10 18:39:55 -05:00
Liz
c803cfea45 update for sensirion API, add gc9a01a library 2025-02-10 18:02:41 -05:00
Liz
ad73b77f18 dot 2025-02-10 17:32:29 -05:00
Liz
8550345e99 try test only again 2025-02-10 17:32:04 -05:00
Liz
c58af8331c Create .uno.test.only 2025-02-10 17:22:53 -05:00
Liz
795ff05593 arduino and lint 2025-02-10 17:20:54 -05:00
Liz
7779de188f
Update code.py 2025-02-10 14:54:30 -05:00
Liz
108f763d40 adding cp and python demo code 2025-02-10 14:43:49 -05:00
Dan Halbert
c1c2897f2b
Merge pull request #2960 from semininja/main
quick fix broken imports/calls of pcf8523
2025-02-07 13:43:05 -05:00
John Edgar Park
fe9142a19c
Merge pull request #2964 from jedgarpark/breakbeat-breadboard
fixed filename
2025-02-05 18:16:19 -08:00
jedgarpark
c1bbd3597b fixed filename 2025-02-05 18:05:50 -08:00
TrevKnows
f0bf67e879
Merge pull request #2934 from adafruit/ESP32-S2-TFT_AS77341_Color_Detection
Added code.py for AS7341 Color detection
2025-02-05 13:50:39 -05:00
Anne Barela
65e8e79950
Merge pull request #2963 from jedgarpark/espresso-water-meter
first commit water meter code
2025-02-05 11:57:27 -05:00
jedgarpark
15aa60f5a7 removed pylint txt file 2025-02-05 08:50:33 -08:00
jedgarpark
104df9166c fixing pylint errors 2 2025-02-04 18:00:36 -08:00
jedgarpark
ba9099d3a2 fixing pylint errors 2025-02-04 17:51:49 -08:00
jedgarpark
4965a40ef5 first commit water meter code 2025-02-04 17:42:04 -08:00
Dan Halbert
b20191babf
Merge pull request #2956 from vegatripy/patch-1
Update mini_pitft_stats.py to use getbbox() instead of getsize()
2025-02-04 13:42:50 -05:00
Dan Halbert
2909bef561
Merge pull request #2944 from pohlt/patch-2
docs: fix comment when turning off I2C power
2025-02-04 13:40:12 -05:00
Dan Halbert
dc09f0db47
Merge pull request #2962 from edenchiang/patch-1
fixed issue of reading Network object in code.py of example for Arduino Nano …
2025-02-04 13:38:05 -05:00
I-Tang Chiang (Eden)
0b6ed775d5
fixed issue of Network object in code.py of example for Arduino Nano RP2040 Connect
CircuitPython version: 9.2.4
2025-02-04 11:34:52 +01:00
Anne Barela
85c13fcbe3
Merge pull request #2961 from adafruit/toddler_timer
Adding code for Toddler Timer
2025-02-03 16:03:39 -05:00
Liz
37e93d87a6 lint 2025-02-03 15:20:40 -05:00
Noe Ruiz
c0d75b8432 fixing pylint
3rd attempt
2025-02-03 15:15:32 -05:00
Noe Ruiz
c38a83ae3a another pylint fix
2nd attempt to fix pylint
2025-02-03 15:08:59 -05:00
Noe Ruiz
b4601f92aa Fixing pylint
fixing errors from pylint
2025-02-03 15:00:54 -05:00
Noe Ruiz
0c432cb85e Adding code for Toddler Timer
Adding code for Toddler Timer
2025-02-03 14:55:28 -05:00
semininja
3a476d56fb quick fix broken imports/calls of pcf8523 2025-02-02 16:32:05 -05:00
foamyguy
91db2f004c
Merge pull request #2959 from FoamyGuy/sparkle_motion_examples
sparkle motion IR remote corrected neopixel pin & count
2025-01-29 14:40:12 -06:00
foamyguy
6204ca349c corrected neopixel pin & count 2025-01-29 14:23:14 -06:00
foamyguy
eae450908e
Merge pull request #2958 from FoamyGuy/sparkle_motion_examples
sparkle motion IR control neopixels examples
2025-01-29 11:47:23 -06:00
foamyguy
62f367bc1e IR test config file 2025-01-29 10:42:09 -06:00
foamyguy
12bf9f8f6e sparkle motion IR control neopixels examples 2025-01-29 10:35:16 -06:00
foamyguy
7a43be2468
Merge pull request #2957 from FoamyGuy/sparkle_motion_examples
sparkle motion examples
2025-01-28 16:58:14 -06:00
foamyguy
69ff3b8e31 sparkle motion examples 2025-01-28 15:43:03 -06:00
vegatripy
9e1eaba7c8
Update mini_pitft_stats.py to use getbbox() instead of getsize()
A little update to avoid message "DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use getbbox or getlength instead."
2025-01-28 15:31:12 +01:00
Carter Nelson
c9f2d95e5a
Merge pull request #2955 from caternuson/hallo_jump_update
Update HalloWing jump sound
2025-01-25 09:30:52 -08:00
caternuson
f70eaa5da4 update hallowing jump sound 2025-01-25 08:17:52 -08:00
Brent Rubell
38f661bf64
Merge pull request #2954 from brentru/fix-iot-bird-feeder
Fix: IoT Bird Feeder
2025-01-24 09:28:20 -06:00
brentru
4c92b0400b Fix wrt feedback 2025-01-24 10:09:41 -05:00
foamyguy
8c1f2a5ac1
Merge pull request #2953 from FoamyGuy/custom_led_animation_fixes
fix grid x/y access
2025-01-23 15:35:23 -06:00
foamyguy
bfa39bedcf fix grid x/y access 2025-01-23 15:10:43 -06:00
Liz
027433f781
Merge pull request #2952 from adafruit/sparkle_arduino
sparkle mini factorytest
2025-01-23 11:46:02 -05:00
BlitzCityDIY
88281cf5ee i2s test 2025-01-23 11:21:49 -05:00
BlitzCityDIY
b3ddb74530 sparkle mini factorytest
factory test for the sparkle motion mini
2025-01-23 11:16:57 -05:00
Liz
daa736c921
Merge pull request #2951 from adafruit/sparkle_arduino
adding arduino sparkle motion mini example
2025-01-23 10:11:16 -05:00
Tom Pohl
24f3c70814
docs: fix comment when turning off I2C power 2025-01-05 11:27:12 +01:00
TrevKnows
eec86c9a55 Added code.py for AS7341 Color detection 2024-12-02 14:46:04 -05:00
foamyguy
93d32ea0bb BusDisplay change 2024-03-21 19:33:28 -05:00
foamyguy
03da135cd7 Fourwire change 2024-03-21 19:19:24 -05:00
foamyguy
fe175e7acb ParallelBus change 2024-03-21 18:44:19 -05:00
foamyguy
74eaa1b1d2 i2cdisplaybus change 2024-03-21 18:35:43 -05:00
foamyguy
53f5f23e66 bitmaptools.blit fix 2024-03-21 17:41:49 -05:00
1603 changed files with 273438 additions and 8012 deletions

View file

@ -61,7 +61,7 @@ jobs:
strategy:
fail-fast: false
matrix:
arduino-platform: ["cpb", "cpc", "cpx_ada", "esp32", "esp8266", "feather32u4", "feather_esp32c6", "feather_m0_express", "feather_m4_express", "feather_rp2040", "feather_rp2040_adalogger", "flora", "funhouse", "gemma", "gemma_m0", "hallowing_m0", "hallowing_m4_tinyusb", "ledglasses_nrf52840", "magtag", "metro_m0", "metro_m0_tinyusb", "metro_m4", "metro_m4_tinyusb", "monster_m4sk", "monster_m4sk_tinyusb", "neokeytrinkey_m0", "neotrellis_m4", "nrf52832", "nrf52840", "pixeltrinkey_m0", "protrinket_5v", "proxlighttrinkey_m0", "pybadge", "pycamera_s3", "pygamer", "pyportal", "qualia_s3_rgb666", "qt2040_trinkey", "qtpy_m0", "qtpy_esp32s2", "rotarytrinkey_m0", "sht4xtrinkey_m0", "slidetrinkey_m0", "trinket_5v", "trinket_m0", "uno"]
arduino-platform: ["cpb", "cpc", "cpx_ada", "esp32", "esp8266", "feather32u4", "feather_esp32c6", "feather_m0_express", "feather_m4_express", "feather_rp2040", "feather_rp2040_adalogger", "feather_rp2350", "flora", "fruit_jam_tinyusb", "funhouse", "gemma", "gemma_m0", "hallowing_m0", "hallowing_m4_tinyusb", "ledglasses_nrf52840", "magtag", "metro_m0", "metro_m0_tinyusb", "metro_m4", "metro_m4_tinyusb", "monster_m4sk", "monster_m4sk_tinyusb", "metro_rp2350", "neokeytrinkey_m0", "neotrellis_m4", "nrf52832", "nrf52840", "pixeltrinkey_m0", "protrinket_5v", "proxlighttrinkey_m0", "pybadge", "pycamera_s3", "pygamer", "pyportal", "qualia_s3_rgb666", "qt2040_trinkey", "qtpy_m0", "qtpy_esp32s2", "rotarytrinkey_m0", "sht4xtrinkey_m0", "slidetrinkey_m0", "trinket_5v", "trinket_m0", "uno"]
runs-on: ubuntu-latest
if: needs.check-if-needed.outputs.answer == 'true'
needs: check-if-needed
@ -97,6 +97,8 @@ jobs:
git clone --quiet https://github.com/adafruit/HID /home/runner/Arduino/libraries/HID_Project
rm -rf /home/runner/Arduino/libraries/ArduinoHttpClient
git clone --quiet https://github.com/arduino-libraries/ArduinoHttpClient.git /home/runner/Arduino/libraries/ArduinoHttpClient
git clone --quiet https://github.com/pschatzmann/ESP32-A2DP /home/runner/Arduino/libraries/ESP32-A2DP
git clone --quiet https://github.com/pschatzmann/arduino-audio-tools /home/runner/Arduino/libraries/arduino-audio-tools
- name: test platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}

View file

@ -8,6 +8,7 @@ import digitalio
from rainbowio import colorwheel
import keypad
import displayio
import i2cdisplaybus
import busio
import adafruit_seesaw.seesaw
import adafruit_seesaw.neopixel
@ -50,7 +51,7 @@ oled_reset = board.D13
i2c = board.STEMMA_I2C()
# STEMMA OLED setup
display_bus = displayio.I2CDisplay(i2c, device_address=0x3D, reset=oled_reset)
display_bus = i2cdisplaybus.I2CDisplayBus(i2c, device_address=0x3D, reset=oled_reset)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=64)
splash = displayio.Group()

View file

@ -0,0 +1,47 @@
// SPDX-FileCopyrightText: 2025 Liz Clark for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#include <Adafruit_MCP23X17.h>
#define NOID_1 0 // MCP23XXX pin LED is attached to
#define NOID_2 4 // MCP23XXX pin LED is attached to
Adafruit_MCP23X17 mcp;
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("8 Channel Solenoid Driver Demo");
if (!mcp.begin_I2C()) {
Serial.println("Couldn't find MCP23017..");
while (1);
}
mcp.pinMode(NOID_1, OUTPUT);
mcp.pinMode(NOID_2, OUTPUT);
Serial.println("Found MCP23017, looping...");
}
void loop() {
Serial.println("Solenoid 1!");
mcp.digitalWrite(NOID_1, HIGH);
delay(500);
mcp.digitalWrite(NOID_1, LOW);
delay(500);
Serial.println("Solenoid 2!");
mcp.digitalWrite(NOID_2, HIGH);
delay(500);
mcp.digitalWrite(NOID_2, LOW);
delay(500);
Serial.println("Together!");
mcp.digitalWrite(NOID_1, HIGH);
mcp.digitalWrite(NOID_2, HIGH);
delay(1000);
mcp.digitalWrite(NOID_1, LOW);
mcp.digitalWrite(NOID_2, LOW);
delay(2000);
Serial.println("Repeat!");
Serial.println();
delay(500);
}

View file

@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2025 Liz Clark for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import board
from adafruit_mcp230xx.mcp23017 import MCP23017
i2c = board.STEMMA_I2C()
mcp = MCP23017(i2c)
noid_1 = mcp.get_pin(0)
noid_2 = mcp.get_pin(4)
noid_1.switch_to_output(value=False)
noid_2.switch_to_output(value=False)
while True:
noid_1.value = True
print(f"Solenoid 1: {noid_1.value}, Solenoid 2: {noid_2.value}")
time.sleep(0.2)
noid_1.value = False
print(f"Solenoid 1: {noid_1.value}, Solenoid 2: {noid_2.value}")
time.sleep(0.2)
noid_2.value = True
print(f"Solenoid 1: {noid_1.value}, Solenoid 2: {noid_2.value}")
time.sleep(0.2)
noid_2.value = False
print(f"Solenoid 1: {noid_1.value}, Solenoid 2: {noid_2.value}")
time.sleep(1)
noid_1.value = True
noid_2.value = True
print(f"Solenoid 1: {noid_1.value}, Solenoid 2: {noid_2.value}")
time.sleep(1)
noid_1.value = False
noid_2.value = False
print(f"Solenoid 1: {noid_1.value}, Solenoid 2: {noid_2.value}")
time.sleep(2)

View file

@ -11,6 +11,7 @@ import adafruit_ahtx0
# OLED
import displayio
import i2cdisplaybus
import terminalio
from adafruit_display_text import label
import adafruit_displayio_ssd1306
@ -25,7 +26,7 @@ aht20 = adafruit_ahtx0.AHTx0(i2c)
#OLED
display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)
display_bus = i2cdisplaybus.I2CDisplayBus(i2c, device_address=0x3C)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=32)
# Make the display context

View file

@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 Liz Clark for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""AS5600 Encoder"""
import usb_hid
import board
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode
import adafruit_as5600
i2c = board.STEMMA_I2C()
sensor = adafruit_as5600.AS5600(i2c)
enc_inc = ConsumerControlCode.VOLUME_INCREMENT
enc_dec = ConsumerControlCode.VOLUME_DECREMENT
cc = ConsumerControl(usb_hid.devices)
last_val = sensor.angle
THRESHOLD = sensor.max_angle // 2 # default max_angle is 4095
# you can change the max_angle. ex: sensor.max_angle = 1000
MIN_CHANGE = 25 # minimum change to register as movement
# increase to make less sensitive, decrease to make more sensitive
while True:
enc_val = sensor.angle
if abs(enc_val - last_val) >= MIN_CHANGE or abs(enc_val - last_val) > THRESHOLD:
# Calculate the difference
diff = enc_val - last_val
# Check for wraparound
if diff > THRESHOLD:
# Wrapped from ~4095 to ~0 (actually turning backwards)
cc.send(enc_dec)
elif diff < -THRESHOLD:
# Wrapped from ~0 to ~4095 (actually turning forwards)
cc.send(enc_inc)
elif diff > 0:
# Normal forward rotation
cc.send(enc_inc)
else:
# Normal backward rotation (diff < 0)
cc.send(enc_dec)
last_val = enc_val

View file

@ -0,0 +1,40 @@
// SPDX-FileCopyrightText: 2025 Carter Nelson for Adafruit Industries
//
// SPDX-License-Identifier: MIT
// Basic ON/OFF control of DC motor via DRV8833
#define AIN1 5
#define AIN2 6
#define SLP 7
void setup() {
Serial.begin(115200);
Serial.println("Adafruit DRV8833 DC Motor Example - ON/OFF");
// configure pins
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(SLP, OUTPUT);
// enable DRV8833
digitalWrite(SLP, HIGH);
}
void loop() {
//
// FORWARD
//
Serial.println("Forward");
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, LOW);
delay(1000);
//
// REVERSE
//
Serial.println("Reverse");
digitalWrite(AIN1, LOW);
digitalWrite(AIN2, HIGH);
delay(1000);
}

View file

@ -0,0 +1,60 @@
// SPDX-FileCopyrightText: 2025 Carter Nelson for Adafruit Industries
//
// SPDX-License-Identifier: MIT
// PWM speed control of DC motor via DRV8833
#define AIN1 5
#define AIN2 6
#define SLP 7
void setup() {
Serial.begin(115200);
Serial.println("Adafruit DRV8833 DC Motor Example - PWM");
// configure pins
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(SLP, OUTPUT);
// enable DRV8833
digitalWrite(SLP, HIGH);
}
void loop() {
//
// FORWARD
//
Serial.println("Forward");
digitalWrite(AIN2, LOW);
// ramp speed up
Serial.println(" ramping up");
for (int duty_cycle=0; duty_cycle<256; duty_cycle++) {
analogWrite(AIN1, duty_cycle);
delay(10);
}
// ramp speed down
Serial.println(" ramping down");
for (int duty_cycle=255; duty_cycle>=0; duty_cycle--) {
analogWrite(AIN1, duty_cycle);
delay(10);
}
//
// REVERSE
//
Serial.println("Reverse");
digitalWrite(AIN1, LOW);
// ramp speed up
Serial.println(" ramping up");
for (int duty_cycle=0; duty_cycle<256; duty_cycle++) {
analogWrite(AIN2, duty_cycle);
delay(10);
}
// ramp speed down
Serial.println(" ramping down");
for (int duty_cycle=255; duty_cycle>=0; duty_cycle--) {
analogWrite(AIN2, duty_cycle);
delay(10);
}
}

View file

@ -0,0 +1,30 @@
// SPDX-FileCopyrightText: 2025 lady ada for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#include <Stepper.h>
// change this to the number of steps on your motor
#define STEPS 200
// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 4, 5, 6, 7);
void setup()
{
Serial.begin(9600);
Serial.println("Stepper test!");
// set the speed of the motor to 30 RPMs
stepper.setSpeed(60);
}
void loop()
{
Serial.println("Forward");
stepper.step(STEPS);
Serial.println("Backward");
stepper.step(-STEPS);
}

View file

@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: 2025 Carter Nelson for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import board
import digitalio
# Configure pins
AIN1 = digitalio.DigitalInOut(board.D5)
AIN2 = digitalio.DigitalInOut(board.D6)
SLP = digitalio.DigitalInOut(board.D7)
AIN1.switch_to_output()
AIN2.switch_to_output()
SLP.switch_to_output()
# Enable DRV8833
SLP.value = True
# Loop forever
while True:
#
# FORWARD
#
print("Forward")
AIN1.value = True
AIN2.value = False
time.sleep(1)
#
# REVERSE
#
print("Reverse")
AIN1.value = False
AIN2.value = True
time.sleep(1)

View file

@ -0,0 +1,48 @@
# SPDX-FileCopyrightText: 2025 Carter Nelson for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import board
import digitalio
import pwmio
# Configure pins
AIN1 = pwmio.PWMOut(board.D5, frequency=2000)
AIN2 = pwmio.PWMOut(board.D6, frequency=2000)
SLP = digitalio.DigitalInOut(board.D7)
SLP.switch_to_output()
# Enable DRV8833
SLP.value = True
# Loop forever
while True:
#
# FORWARD
#
print("Forward")
AIN2.duty_cycle = 0
print(" ramping up")
for duty_cycle in range(0, 65536, 100):
AIN1.duty_cycle = duty_cycle
time.sleep(0.01)
print(" ramping down")
for duty_cycle in range(65535, -1, -100):
AIN1.duty_cycle = duty_cycle
time.sleep(0.01)
#
# REVERSE
#
print("Reverse")
AIN1.duty_cycle = 0
print(" ramping up")
for duty_cycle in range(0, 65536, 100):
AIN2.duty_cycle = duty_cycle
time.sleep(0.01)
print(" ramping down")
for duty_cycle in range(65535, -1, -100):
AIN2.duty_cycle = duty_cycle
time.sleep(0.01)

View file

@ -93,7 +93,7 @@ void disableInternalPower() {
#endif
#if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
// turn on the I2C power by setting pin to rest state (off)
// turn off the I2C power by setting pin to rest state (off)
pinMode(PIN_I2C_POWER, INPUT);
pinMode(NEOPIXEL_POWER, OUTPUT);
digitalWrite(NEOPIXEL_POWER, LOW);

View file

@ -109,16 +109,32 @@ void setup() {
digitalWrite(ESP32_RESETN, HIGH);
pixel.setPixelColor(0, 20, 20, 0); pixel.show();
delay(100);
#if defined(LED_BUILTIN)
pinMode(LED_BUILTIN, OUTPUT);
#endif
}
void loop() {
while (Serial.available()) {
#if defined(ARDUINO_ARCH_RP2040) // Neopixel is blocking and this annoys esptool
#if defined(LED_BUILTIN)
digitalWrite(LED_BUILTIN, HIGH);
#endif
#else
pixel.setPixelColor(0, 10, 0, 0); pixel.show();
#endif
SerialESP32.write(Serial.read());
}
while (SerialESP32.available()) {
#if defined(ARDUINO_ARCH_RP2040) // Neopixel is blocking and this annoys esptool
#if defined(LED_BUILTIN)
digitalWrite(LED_BUILTIN, LOW);
#endif
#else
pixel.setPixelColor(0, 0, 0, 10); pixel.show();
#endif
Serial.write(SerialESP32.read());
}
}

View file

@ -0,0 +1,105 @@
// SPDX-FileCopyrightText: 2025 Limor Fried for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#include "config.h"
#include <Adafruit_BME280.h>
#include <Adafruit_NeoPixel.h>
Adafruit_BME280 bme; // I2C
AdafruitIO_Feed *temperature = io.feed("temperature");
AdafruitIO_Feed *humidity = io.feed("humidity");
AdafruitIO_Feed *pressure = io.feed("pressure");
float temp, humid, pres;
Adafruit_NeoPixel pixel(1, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);
void setup() {
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
// wait for serial monitor to open
//while(! Serial);
// turn on neopixel
pinMode(NEOPIXEL_POWER, OUTPUT);
digitalWrite(NEOPIXEL_POWER, HIGH);
pixel.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
pixel.setBrightness(10); // not so bright
pixel.setPixelColor(0, 0xFF0000); // red
pixel.show();
if (! bme.begin()) {
Serial.println("Could not find a valid BME280 sensor, check wiring, address, sensor ID!");
deepSleep();
}
Serial.println("Found BME280");
float temp = bme.readTemperature();
float pres = bme.readPressure() / 100.0F;
float hum = bme.readHumidity();
// shhh time to close your eyes
bme.setSampling(Adafruit_BME280::MODE_SLEEP,
Adafruit_BME280::SAMPLING_X16, Adafruit_BME280::SAMPLING_X16, Adafruit_BME280::SAMPLING_X16,
Adafruit_BME280::FILTER_OFF,
Adafruit_BME280::STANDBY_MS_1000);
Serial.print("Connecting to Adafruit IO");
pixel.setPixelColor(0, 0xFFFF00); // yellow
pixel.show();
// connect to io.adafruit.com
io.connect();
// wait for a connection
while(io.status() < AIO_CONNECTED) {
Serial.print(".");
delay(100);
}
// we are connected
pixel.setPixelColor(0, 0x00FF00); // green
pixel.show();
Serial.println();
Serial.println(io.statusText());
io.run();
temp = temp * 9.0 / 5.0 + 32;
Serial.print("Temperature = ");
Serial.print(temp);
Serial.println(" *F");
temperature->save(temp);
Serial.print("Pressure = ");
Serial.print(pres);
Serial.println(" hPa");
pressure->save(pres);
Serial.print("Humidity = ");
Serial.print(hum);
Serial.println(" %");
humidity->save(hum);
Serial.println();
deepSleep();
}
void loop() {
// we never get here!
}
void deepSleep() {
pinMode(NEOPIXEL_POWER, OUTPUT);
digitalWrite(NEOPIXEL_POWER, LOW); // off
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
esp_sleep_enable_timer_wakeup(300000000); // 5 minutes
esp_deep_sleep_start();
}

View file

@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: 2025 Limor Fried for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#define IO_USERNAME "your-aio-username"
#define IO_KEY "your-aio-token"
#define WIFI_SSID "your-wifi-ssid"
#define WIFI_PASS "your-wifi-pass"
#include "AdafruitIO_WiFi.h"
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);

View file

@ -3,6 +3,8 @@
"""
CircuitPython Adafruit IO Example for BME280 and LC709203 Sensors
"""
from os import getenv
import time
import ssl
import alarm
@ -14,11 +16,21 @@ import adafruit_requests
from adafruit_io.adafruit_io import IO_HTTP, AdafruitIO_RequestError
from adafruit_lc709203f import LC709203F, PackSize
from adafruit_bme280 import basic as adafruit_bme280
try:
from secrets import secrets
except ImportError:
print("WiFi and Adafruit IO credentials are kept in secrets.py, please add them there!")
raise
# Get WiFi details and Adafruit IO keys, ensure these are setup in settings.toml
# (visit io.adafruit.com if you need to create an account, or if you need your Adafruit IO key.)
ssid = getenv("CIRCUITPY_WIFI_SSID")
password = getenv("CIRCUITPY_WIFI_PASSWORD")
aio_username = getenv("ADAFRUIT_AIO_USERNAME")
aio_key = getenv("ADAFRUIT_AIO_KEY")
if None in [ssid, password, aio_username, aio_key]:
raise RuntimeError(
"WiFi and Adafruit IO settings are kept in settings.toml, "
"please add them there. The settings file must contain "
"'CIRCUITPY_WIFI_SSID', 'CIRCUITPY_WIFI_PASSWORD', "
"'ADAFRUIT_AIO_USERNAME' and 'ADAFRUIT_AIO_KEY' at a minimum."
)
# Duration of sleep in seconds. Default is 600 seconds (10 minutes).
# Feather will sleep for this duration between sensor readings / sending data to AdafruitIO
@ -78,9 +90,9 @@ def send_io_data(feed, value):
# Wi-Fi connections can have issues! This ensures the code will continue to run.
try:
# Connect to Wi-Fi
wifi.radio.connect(secrets["ssid"], secrets["password"])
print("Connected to {}!".format(secrets["ssid"]))
print("IP:", wifi.radio.ipv4_address)
wifi.radio.connect(ssid, password)
print(f"Connected to {ssid}!")
print(f"IP: {wifi.radio.ipv4_address}")
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())
@ -90,12 +102,6 @@ except Exception as e: # pylint: disable=broad-except
print(e)
go_to_sleep(60)
# Set your Adafruit IO Username and Key in secrets.py
# (visit io.adafruit.com if you need to create an account,
# or if you need your Adafruit IO key.)
aio_username = secrets["aio_username"]
aio_key = secrets["aio_key"]
# Initialize an Adafruit IO HTTP API object
io = IO_HTTP(aio_username, aio_key, requests)

View file

@ -5,8 +5,8 @@ CircuitPython Simple Example for BME280 and LC709203 Sensors
"""
import time
import board
from adafruit_bme280 import basic as adafruit_bme280
from adafruit_lc709203f import LC709203F, PackSize
from adafruit_bme280 import basic as adafruit_bme280
# Create sensor objects, using the board's default I2C bus.
i2c = board.I2C() # uses board.SCL and board.SDA

View file

@ -0,0 +1,110 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
CircuitPython example for deep sleep and BME280 sensor sending data
to Adafruit IO.
"""
from os import getenv
import time
import alarm
import board
import digitalio
import neopixel
import wifi
from adafruit_bme280 import advanced as adafruit_bme280
import adafruit_connection_manager
import adafruit_requests
from adafruit_io.adafruit_io import IO_HTTP, AdafruitIO_RequestError
# enable power to NeoPixels.
np_power = digitalio.DigitalInOut(board.NEOPIXEL_POWER)
np_power.switch_to_output(value=True)
# standard LED
builtin_led = digitalio.DigitalInOut(board.LED)
builtin_led.switch_to_output(value=True)
# neopixel to use for status
status_pixel = neopixel.NeoPixel(
board.NEOPIXEL, 1, brightness=0.1, pixel_order=neopixel.GRB, auto_write=True
)
status_pixel[0] = 0xFF0000
# Create sensor object, using the board's default I2C bus.
i2c = board.I2C() # uses board.SCL and board.SDA
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
print("Found BME280")
# change this to match the location's pressure (hPa) at sea level
bme280.sea_level_pressure = 1013.25
# temperature converted to F
temperature = bme280.temperature * 9 / 5 + 32
humidity = bme280.relative_humidity
pressure = bme280.pressure
print("\nTemperature: %0.1f F" % temperature)
print("Humidity: %0.1f %%" % humidity)
print("Pressure: %0.1f hPa" % pressure)
bme280.mode = adafruit_bme280.MODE_SLEEP
bme280.overscan_temperature = adafruit_bme280.OVERSCAN_X16
bme280.overscan_humidity = adafruit_bme280.OVERSCAN_X16
bme280.overscan_pressure = adafruit_bme280.OVERSCAN_X16
bme280.iir_filter = adafruit_bme280.IIR_FILTER_DISABLE
bme280.standby_period = adafruit_bme280.STANDBY_TC_1000
# set status pixel to yellow
status_pixel[0] = 0xFFFF00
print("Connecting to AdafruitIO")
# Get WiFi details and Adafruit IO keys, ensure these are setup in settings.toml
# (visit io.adafruit.com if you need to create an account, or if you need your Adafruit IO key.)
ssid = getenv("WIFI_SSID")
password = getenv("WIFI_PASSWORD")
aio_username = getenv("ADAFRUIT_AIO_USERNAME")
aio_key = getenv("ADAFRUIT_AIO_KEY")
print("Connecting to %s" % ssid)
wifi.radio.connect(ssid, password)
print("Connected to %s!" % ssid)
# setup socket pool and requests session
pool = adafruit_connection_manager.get_radio_socketpool(wifi.radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(wifi.radio)
requests = adafruit_requests.Session(pool, ssl_context)
# Initialize an Adafruit IO HTTP API object
io = IO_HTTP(aio_username, aio_key, requests)
# set status pixel to green
status_pixel[0] = 0x00FF00
try:
# Get the feeds from Adafruit IO
temperature_feed = io.get_feed("temperature")
humidity_feed = io.get_feed("humidity")
pressure_feed = io.get_feed("pressure")
# send data to the feeds
io.send_data(temperature_feed["key"], temperature)
io.send_data(humidity_feed["key"], humidity)
io.send_data(pressure_feed["key"], pressure)
except AdafruitIO_RequestError as e:
print(e)
print(
"You must create feeds on AdafruitIO for: temperature, humidity, and pressure"
)
# turn off the neopixel and builtin LED
np_power.value = False
builtin_led.value = False
# Create an alarm that will trigger 5 minutes from now.
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + (5 * 60))
# Exit the program, and then deep sleep until the alarm wakes us.
alarm.exit_and_deep_sleep_until_alarms(time_alarm)
# Does not return, so we never get here.

View file

@ -3,6 +3,8 @@
"""
CircuitPython Adafruit IO Example for LC709203 Sensor
"""
from os import getenv
import time
import ssl
import alarm
@ -13,11 +15,21 @@ import socketpool
import adafruit_requests
from adafruit_io.adafruit_io import IO_HTTP
from adafruit_lc709203f import LC709203F, PackSize
try:
from secrets import secrets
except ImportError:
print("WiFi and Adafruit IO credentials are kept in secrets.py, please add them there!")
raise
# Get WiFi details and Adafruit IO keys, ensure these are setup in settings.toml
# (visit io.adafruit.com if you need to create an account, or if you need your Adafruit IO key.)
ssid = getenv("CIRCUITPY_WIFI_SSID")
password = getenv("CIRCUITPY_WIFI_PASSWORD")
aio_username = getenv("ADAFRUIT_AIO_USERNAME")
aio_key = getenv("ADAFRUIT_AIO_KEY")
if None in [ssid, password, aio_username, aio_key]:
raise RuntimeError(
"WiFi and Adafruit IO settings are kept in settings.toml, "
"please add them there. The settings file must contain "
"'CIRCUITPY_WIFI_SSID', 'CIRCUITPY_WIFI_PASSWORD', "
"'ADAFRUIT_AIO_USERNAME' and 'ADAFRUIT_AIO_KEY' at a minimum."
)
# Duration of sleep in seconds. Default is 600 seconds (10 minutes).
# Feather will sleep for this duration between sensor readings / sending data to AdafruitIO
@ -58,9 +70,9 @@ def send_io_data(feed, value):
# Wi-Fi connections can have issues! This ensures the code will continue to run.
try:
# Connect to Wi-Fi
wifi.radio.connect(secrets["ssid"], secrets["password"])
print("Connected to {}!".format(secrets["ssid"]))
print("IP:", wifi.radio.ipv4_address)
wifi.radio.connect(ssid, password)
print(f"Connected to {ssid}!")
print(f"IP: {wifi.radio.ipv4_address}")
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())
@ -70,12 +82,6 @@ except Exception as e: # pylint: disable=broad-except
print(e)
go_to_sleep(60)
# Set your Adafruit IO Username and Key in secrets.py
# (visit io.adafruit.com if you need to create an account,
# or if you need your Adafruit IO key.)
aio_username = secrets["aio_username"]
aio_key = secrets["aio_key"]
# Initialize an Adafruit IO HTTP API object
io = IO_HTTP(aio_username, aio_key, requests)

View file

@ -3,6 +3,8 @@
"""
CircuitPython GitHub Stars viewer
"""
from os import getenv
import time
import ssl
import wifi
@ -13,12 +15,17 @@ from adafruit_display_text import bitmap_label
from adafruit_bitmap_font import bitmap_font
import adafruit_requests
# Get WiFi details secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
# Get WiFi details, ensure these are setup in settings.toml
ssid = getenv("CIRCUITPY_WIFI_SSID")
password = getenv("CIRCUITPY_WIFI_PASSWORD")
if None in [ssid, password]:
raise RuntimeError(
"WiFi settings are kept in settings.toml, "
"please add them there. The settings file must contain "
"'CIRCUITPY_WIFI_SSID', 'CIRCUITPY_WIFI_PASSWORD', "
"at a minimum."
)
display = board.DISPLAY
@ -38,10 +45,10 @@ group.append(text_area)
display.root_group = group
# Connect to WiFi
print("Connecting to %s"%secrets["ssid"])
wifi.radio.connect(secrets["ssid"], secrets["password"])
print("Connected to %s!"%secrets["ssid"])
print("My IP address is", wifi.radio.ipv4_address)
print(f"Connecting to {ssid}")
wifi.radio.connect(ssid, password)
print(f"Connected to {ssid}!")
print(f"My IP address is {wifi.radio.ipv4_address}")
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())

View file

@ -11,7 +11,7 @@ LOOP = False # Update to True loop WAV playback. False plays once.
audio = audiobusio.I2SOut(board.A2, board.A1, board.A0)
with open("chikken.wav", "rb") as wave_file:
with open("booploop.wav", "rb") as wave_file:
wav = audiocore.WaveFile(wave_file)
print("Playing wav file!")

View file

@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: MIT
from os import getenv
import time
import board
import busio
@ -22,14 +23,22 @@ USE_CELSIUS = False
# Interval the sensor publishes to Adafruit IO, in minutes
PUBLISH_INTERVAL = 10
### WiFi ###
# Get WiFi details and Adafruit IO keys, ensure these are setup in settings.toml
# (visit io.adafruit.com if you need to create an account, or if you need your Adafruit IO key.)
ssid = getenv("CIRCUITPY_WIFI_SSID")
password = getenv("CIRCUITPY_WIFI_PASSWORD")
aio_username = getenv("ADAFRUIT_AIO_USERNAME")
aio_key = getenv("ADAFRUIT_AIO_KEY")
# Get wifi details and more from a secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
if None in [ssid, password, aio_username, aio_key]:
raise RuntimeError(
"WiFi and Adafruit IO settings are kept in settings.toml, "
"please add them there. The settings file must contain "
"'CIRCUITPY_WIFI_SSID', 'CIRCUITPY_WIFI_PASSWORD', "
"'ADAFRUIT_AIO_USERNAME' and 'ADAFRUIT_AIO_KEY' at a minimum."
)
### WiFi ###
# AirLift FeatherWing
esp32_cs = DigitalInOut(board.D13)
@ -38,8 +47,8 @@ esp32_ready = DigitalInOut(board.D11)
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2)
wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light)
status_pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2)
wifi = adafruit_esp32spi_wifimanager.WiFiManager(esp, ssid, password, status_pixel=status_pixel)
# Connect to a PM2.5 sensor over UART
reset_pin = None
@ -142,7 +151,7 @@ def read_bme(is_celsius=False):
# Create an instance of the Adafruit IO HTTP client
io = IO_HTTP(secrets["aio_user"], secrets["aio_key"], wifi)
io = IO_HTTP(aio_username, aio_key, wifi)
# Describes feeds used to hold Adafruit IO data
feed_aqi = io.get_feed("air-quality-sensor.aqi")
@ -150,11 +159,11 @@ feed_aqi_category = io.get_feed("air-quality-sensor.category")
feed_humidity = io.get_feed("air-quality-sensor.humidity")
feed_temperature = io.get_feed("air-quality-sensor.temperature")
# Set up location metadata from secrets.py file
# Set up location metadata from settings.toml file
location_metadata = {
"lat": secrets["latitude"],
"lon": secrets["longitude"],
"ele": secrets["elevation"],
"lat": getenv("latitude"),
"lon": getenv("longitude"),
"ele": getenv("elevation"),
}
elapsed_minutes = 0

View file

@ -14,12 +14,19 @@ from adafruit_esp32spi import adafruit_esp32spi_wifimanager
import adafruit_minimqtt.adafruit_minimqtt as MQTT
### WiFi ###
# Get WiFi details, ensure these are setup in settings.toml
ssid = os.getenv("CIRCUITPY_WIFI_SSID")
password = os.getenv("CIRCUITPY_WIFI_PASSWORD")
secrets = {
"ssid" : os.getenv("CIRCUITPY_WIFI_SSID"),
"password" : os.getenv("CIRCUITPY_WIFI_PASSWORD"),
}
if None in [ssid, password]:
raise RuntimeError(
"WiFi settings are kept in settings.toml, "
"please add them there. The settings file must contain "
"'CIRCUITPY_WIFI_SSID', 'CIRCUITPY_WIFI_PASSWORD', "
"at a minimum."
)
### WiFi ###
# If you are using a board with pre-defined ESP32 Pins:
esp32_cs = DigitalInOut(board.ESP_CS)
@ -34,19 +41,19 @@ esp32_reset = DigitalInOut(board.ESP_RESET)
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
"""Use below for Most Boards"""
status_light = neopixel.NeoPixel(
status_pixel = neopixel.NeoPixel(
board.NEOPIXEL, 1, brightness=0.2
) # Uncomment for Most Boards
"""Uncomment below for ItsyBitsy M4"""
# status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
# status_pixel = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
# Uncomment below for an externally defined RGB LED
# import adafruit_rgbled
# from adafruit_esp32spi import PWMOut
# RED_LED = PWMOut.PWMOut(esp, 26)
# GREEN_LED = PWMOut.PWMOut(esp, 27)
# BLUE_LED = PWMOut.PWMOut(esp, 25)
# status_light = adafruit_rgbled.RGBLED(RED_LED, BLUE_LED, GREEN_LED)
wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light)
# status_pixel = adafruit_rgbled.RGBLED(RED_LED, BLUE_LED, GREEN_LED)
wifi = adafruit_esp32spi_wifimanager.WiFiManager(esp, ssid, password, status_pixel=status_pixel)
# Set up a pin for controlling the relay
power_pin = DigitalInOut(board.D3)

View file

@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: MIT
from os import getenv
import time
import board
import busio
@ -14,6 +15,21 @@ from adafruit_esp32spi import adafruit_esp32spi_wifimanager
import adafruit_minimqtt.adafruit_minimqtt as MQTT
# Get WiFi details and Adafruit IO keys, ensure these are setup in settings.toml
# (visit io.adafruit.com if you need to create an account, or if you need your Adafruit IO key.)
ssid = getenv("CIRCUITPY_WIFI_SSID")
password = getenv("CIRCUITPY_WIFI_PASSWORD")
aio_username = getenv("ADAFRUIT_AIO_USERNAME")
aio_key = getenv("ADAFRUIT_AIO_KEY")
if None in [ssid, password, aio_username, aio_key]:
raise RuntimeError(
"WiFi and Adafruit IO settings are kept in settings.toml, "
"please add them there. The settings file must contain "
"'CIRCUITPY_WIFI_SSID', 'CIRCUITPY_WIFI_PASSWORD', "
"'ADAFRUIT_AIO_USERNAME' and 'ADAFRUIT_AIO_KEY' at a minimum."
)
### Sensor Calibration ###
# Appliance power LED's light level, in Lux
APPLIANCE_ON_LUX = 30.0
@ -22,13 +38,6 @@ SENSOR_READ_TIME = 10.0
### WiFi ###
# Get wifi details and more from a secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
# If you are using a board with pre-defined ESP32 Pins:
esp32_cs = DigitalInOut(board.ESP_CS)
esp32_ready = DigitalInOut(board.ESP_BUSY)
@ -42,19 +51,19 @@ esp32_reset = DigitalInOut(board.ESP_RESET)
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
"""Use below for Most Boards"""
status_light = neopixel.NeoPixel(
status_pixel = neopixel.NeoPixel(
board.NEOPIXEL, 1, brightness=0.2
) # Uncomment for Most Boards
"""Uncomment below for ItsyBitsy M4"""
# status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
# status_pixel = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
# Uncomment below for an externally defined RGB LED
# import adafruit_rgbled
# from adafruit_esp32spi import PWMOut
# RED_LED = PWMOut.PWMOut(esp, 26)
# GREEN_LED = PWMOut.PWMOut(esp, 27)
# BLUE_LED = PWMOut.PWMOut(esp, 25)
# status_light = adafruit_rgbled.RGBLED(RED_LED, BLUE_LED, GREEN_LED)
wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light)
# status_pixel = adafruit_rgbled.RGBLED(RED_LED, BLUE_LED, GREEN_LED)
wifi = adafruit_esp32spi_wifimanager.WiFiManager(esp, ssid, password, status_pixel=status_pixel)
# Set up a pin for controlling the relay
power_pin = DigitalInOut(board.D3)
@ -67,10 +76,10 @@ sensor = adafruit_bh1750.BH1750(i2c)
### Feeds ###
# Set up a feed named Relay for subscribing to the relay feed on Adafruit IO
feed_relay = secrets["aio_username"] + "/feeds/relay"
feed_relay = f"{aio_username}/feeds/relay"
# Set up a feed named status for subscribing to the status feed on Adafruit IO
feed_status = secrets["aio_username"] + "/feeds/status"
feed_status = f"{aio_username}/feeds/status"
### Code ###
@ -122,8 +131,8 @@ ssl_context = adafruit_connection_manager.get_radio_ssl_context(esp)
# Set up a MiniMQTT Client
client = MQTT.MQTT(
broker="io.adafruit.com",
username=secrets["aio_username"],
password=secrets["aio_key"],
username=aio_username,
password=aio_key,
socket_pool=pool,
ssl_context=ssl_context,
)

View file

@ -0,0 +1,27 @@
{
"exportVersion": "1.0.0",
"exportedBy": "tyeth_demo",
"exportedAt": "2025-05-02T17:08:03.857Z",
"exportedFromDevice": {
"board": "rpi-pico-w",
"firmwareVersion": "1.0.0-beta.100"
},
"components": [
{
"name": "Reed Switch",
"pinName": "D13",
"type": "reed_switch",
"mode": "DIGITAL",
"direction": "INPUT",
"period": 0,
"pull": "UP",
"isPin": true,
"visualization": {
"offLabel": "Open",
"offIcon": "fa6:solid:door-open",
"onLabel": "Closed",
"onIcon": "fa6:regular:door-closed"
}
}
]
}

View file

@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: MIT
from os import getenv
import time
import board
import busio
@ -13,14 +14,22 @@ import neopixel
import adafruit_minimqtt.adafruit_minimqtt as MQTT
from adafruit_io.adafruit_io import IO_MQTT
### WiFi ###
# Get WiFi details and Adafruit IO keys, ensure these are setup in settings.toml
# (visit io.adafruit.com if you need to create an account, or if you need your Adafruit IO key.)
ssid = getenv("CIRCUITPY_WIFI_SSID")
password = getenv("CIRCUITPY_WIFI_PASSWORD")
aio_username = getenv("ADAFRUIT_AIO_USERNAME")
aio_key = getenv("ADAFRUIT_AIO_KEY")
# Get wifi details and more from a secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
if None in [ssid, password, aio_username, aio_key]:
raise RuntimeError(
"WiFi and Adafruit IO settings are kept in settings.toml, "
"please add them there. The settings file must contain "
"'CIRCUITPY_WIFI_SSID', 'CIRCUITPY_WIFI_PASSWORD', "
"'ADAFRUIT_AIO_USERNAME' and 'ADAFRUIT_AIO_KEY' at a minimum."
)
### WiFi ###
# If you are using a board with pre-defined ESP32 Pins:
esp32_cs = DigitalInOut(board.ESP_CS)
@ -35,19 +44,19 @@ esp32_reset = DigitalInOut(board.ESP_RESET)
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
"""Use below for Most Boards"""
status_light = neopixel.NeoPixel(
status_pixel = neopixel.NeoPixel(
board.NEOPIXEL, 1, brightness=0.2
) # Uncomment for Most Boards
"""Uncomment below for ItsyBitsy M4"""
# status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
# status_pixel = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
# Uncomment below for an externally defined RGB LED
# import adafruit_rgbled
# from adafruit_esp32spi import PWMOut
# RED_LED = PWMOut.PWMOut(esp, 26)
# GREEN_LED = PWMOut.PWMOut(esp, 27)
# BLUE_LED = PWMOut.PWMOut(esp, 25)
# status_light = adafruit_rgbled.RGBLED(RED_LED, BLUE_LED, GREEN_LED)
wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light)
# status_pixel = adafruit_rgbled.RGBLED(RED_LED, BLUE_LED, GREEN_LED)
wifi = adafruit_esp32spi_wifimanager.WiFiManager(esp, ssid, password, status_pixel=status_pixel)
# Set up a pin for controlling the relay
power_pin = DigitalInOut(board.D3)
@ -89,11 +98,11 @@ def on_message(client, feed_id, payload):
def on_relay_msg(client, topic, message):
# Method called whenever user/feeds/relay has a new value
if message == "morning":
print("Morning - turning outlet ON")
if message == "1":
print("Received 1 - turning outlet ON")
power_pin.value = True
elif message == "night":
print("Night - turning outlet OFF")
elif message == "0":
print("Received 0 - turning outlet OFF")
power_pin.value = False
else:
print("Unexpected value received on relay feed.")
@ -110,8 +119,8 @@ ssl_context = adafruit_connection_manager.get_radio_ssl_context(esp)
# Initialize a new MQTT Client object
mqtt_client = MQTT.MQTT(
broker="io.adafruit.com",
username=secrets["aio_username"],
password=secrets["aio_key"],
username=aio_username,
password=aio_key,
socket_pool=pool,
ssl_context=ssl_context,
)

View file

@ -99,7 +99,7 @@ while True:
time.sleep(30)
# Stepper 1
if not st1.isAlive() and int(stepper_start.value):
if not st1.is_alive() and int(stepper_start.value):
stepper_1_steps = aio.receive(feed_step_1_steps.key)
stepper_1_steps = int(stepper_1_steps.value)
if stepper_1_steps > 0: # stepper slider is set
@ -125,7 +125,7 @@ while True:
st1.start()
# Stepper 2
if not st2.isAlive() and int(stepper_start.value):
if not st2.is_alive() and int(stepper_start.value):
stepper_2_steps = aio.receive(feed_step_2_steps.key)
stepper_2_steps = int(stepper_2_steps.value)
if stepper_2_steps > 0: # stepper slider is set

View file

@ -0,0 +1,83 @@
{
"exportVersion": "1.0.0",
"exportedBy": "tyeth",
"exportedAt": "2025-06-10T18:13:03.071Z",
"exportedFromDevice": {
"board": "rpi-pico-w",
"firmwareVersion": "1.0.0-beta.100"
},
"components": [
{
"name": "💦 Wee Button",
"pinName": "D18",
"type": "push_button",
"mode": "DIGITAL",
"direction": "INPUT",
"period": 0,
"pull": "UP",
"isPin": true
},
{
"name": "💦 Wee LED",
"pinName": "D2",
"type": "led",
"mode": "DIGITAL",
"direction": "OUTPUT",
"isPin": true
},
{
"name": "💩 Poo Button",
"pinName": "D19",
"type": "push_button",
"mode": "DIGITAL",
"direction": "INPUT",
"period": 0,
"pull": "UP",
"isPin": true
},
{
"name": "💩 Poo LED",
"pinName": "D3",
"type": "led",
"mode": "DIGITAL",
"direction": "OUTPUT",
"isPin": true
},
{
"name": "❌ Didn't Go Button",
"pinName": "D20",
"type": "push_button",
"mode": "DIGITAL",
"direction": "INPUT",
"period": 0,
"pull": "UP",
"isPin": true
},
{
"name": "❌ Didn't Go LED",
"pinName": "D4",
"type": "led",
"mode": "DIGITAL",
"direction": "OUTPUT",
"isPin": true
},
{
"name": "🔔 Tell Adult Button",
"pinName": "D21",
"type": "push_button",
"mode": "DIGITAL",
"direction": "INPUT",
"period": 0,
"pull": "UP",
"isPin": true
},
{
"name": "🔔 Tell Adult LED",
"pinName": "D5",
"type": "led",
"mode": "DIGITAL",
"direction": "OUTPUT",
"isPin": true
}
]
}

View file

@ -0,0 +1,72 @@
<b>🌟 Daily Potty Training Report 🌟</b>
Hi there! Here's how our little superstar did:
---
<b>🚽 Successful Wees: {{ vars.wee_progress }}</b>
{% for i in (1..vars.wee_progress) %}💧{% endfor %}
{% if vars.wee_progress <= 5 -%}
Great start! Every success counts, and they're building good habits one wee at a time! 🌱
{% elsif vars.wee_progress <= 15 -%}
Fantastic progress! They're really getting the hang of this - keep up the amazing work! 🎯
{% else -%}
SUPERSTAR ALERT! 🌟 Absolutely crushing it with those wee successes! They're a potty champion! 🏆
{% endif %}---
<b>💩 Successful Poos: {{ vars.poo_progress }}</b>
{% for i in (1..vars.poo_progress) %}🟤{% endfor %}
{% if vars.poo_progress == 0 -%}
Poos can be tricky, but they're being so brave! Every try is a step forward! 💪
{% elsif vars.poo_progress < 2 -%}
Look at them go! They're becoming a real poo pro - that's awesome progress! 🎉
{% else -%}
POO CHAMPION! 🏅 They've mastered one of the trickiest parts - so proud! 🎊
{% endif %}---
<b>🤝 Told an Adult: {{ vars.informed_progress }}</b>
{% for i in (1..vars.informed_progress) %}🗣️{% endfor %}
{% if vars.informed_progress <= 5 -%}
Communication is key! Keep practicing saying when they need to go - They're doing great! 📢
{% elsif vars.informed_progress <= 15 -%}
Wonderful communication skills! They're really good at letting us know - that's so helpful! 👏
{% else -%}
COMMUNICATION SUPERSTAR! 🌟 They're amazing at telling adults - that's such a big kid skill! 🎯
{% endif %}---
<b>👻 Nothing Happened: {{ vars.nothing_progress }}</b>
{% for i in (1..vars.nothing_progress) %}⭕{% endfor %}
{% if vars.nothing_progress <= 3 -%}
That's okay! Trying is what matters, and their body will let them know when it's ready! 🌈
{% else -%}
So patient and persistent! Even when nothing happens, they keep trying - that's real determination! 💫
{% endif %}---
<b>📊 Daily Summary:</b>
{% capture total_tries -%}{{ vars.wee_progress | plus: vars.poo_progress | plus: vars.nothing_progress }}{% endcapture -%}
{% capture successes -%}{{ vars.wee_progress | plus: vars.poo_progress }}{% endcapture -%}
{% capture success_rate -%}{% if total_tries != "0" -%}{{ successes | times: 100 | divided_by: total_tries }}{% else -%}100{% endif -%}{% endcapture -%}
{% capture bar_filled -%}{{ success_rate | divided_by: 10 }}{% endcapture -%}
{% capture bar_empty -%}{{ 10 | minus: bar_filled }}{% endcapture -%}
Total potty visits: {{ total_tries }}
Success rate: {{ success_rate }}% [{%- for i in (1..bar_filled) -%}█{%- endfor -%}{%- for i in (1..bar_empty) -%}░{%- endfor -%}]
{%- assign total_events = vars.wee_progress | plus: vars.poo_progress | plus: vars.nothing_progress | plus: vars.informed_progress -%}
({{ total_events }} events today )
{% if total_events <= 3 %}
💝 <b>Today:</b> They're doing such a great job learning! Every day gets a little easier...
{% elsif total_events <= 5 %}
🌟 <b>Today:</b> Ayee! They're really getting the hang of this potty training thing! Keep it up!
{% elsif total_events <= 8 %}
🌟 <b>Today:</b> WOW! Look at all that practice! They're becoming such a potty expert.
{% else %}
🏆 <b>Today:</b> INCREDIBLE DAY! They're absolutely rocking this potty training journey! 🎊🎉
{%- endif %}
Keep being awesome!
With love and high-fives! 🙌
---
{%- assign event_mod = total_events | modulo: 3 %}
{% if event_mod == 0 -%}
<i>P.S. Remember: Every expert was once a beginner - they're doing brilliantly! 🌟</i>
{% elsif event_mod == 1 -%}
<i>P.S. Fun fact: Even superheroes had to learn to use the potty! 🦸</i>
{% else -%}
<i>P.S. Remember: accidents are just practice in disguise! They're doing amazingly! 💕</i>
{% endif %}

View file

@ -0,0 +1,71 @@
// SPDX-FileCopyrightText: 2025 Tim Cocks for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#include <Adafruit_NeoPixel.h>
int sensorPin = A0; // select the input pin for the potentiometer
int neoPixelPin = 4; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
int readings[10];
size_t count = 0;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(1, neoPixelPin, NEO_GRB + NEO_KHZ800);
// Insert an int value at index 0 of an int array, shifting all other elements up.
// If the array already contains 'maxCount' elements, the last one is dropped.
// 'count' is the number of valid elements currently stored in the array.
void insert(int arr[], size_t maxCount, int value, size_t &count){
// Determine how many elements we need to shift (cannot exceed the array bounds)
size_t shiftCount = (count < maxCount) ? count : maxCount - 1;
// Shift elements up by one position
for (size_t i = shiftCount; i > 0; --i) {
arr[i] = arr[i - 1];
}
// Insert the new value at the beginning
arr[0] = value;
// Update the element count
if (count < maxCount) {
++count; // we added a new element
} // else count stays the same the last element was overwritten
}
// Input an array of 10 or fewer int's, and a count of how many have values
// Returns average of the values in the array.
int average(int arr[], size_t count){
int sum = 0;
for(int i = 0; i < 10; i++){
sum = sum + arr[i];
}
return sum / count;
}
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
void setup() {
Serial.begin(115200);
strip.begin();
}
void loop() {
sensorValue = analogRead(sensorPin);
insert(readings, 10, sensorValue, count);
strip.setPixelColor(0, Wheel(average(readings, count) / 4));
strip.show();
}

View file

@ -0,0 +1,36 @@
# SPDX-FileCopyrightText: 2025 Tim Cocks for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
NeoPot NeoPixel Rainbow Demo
"""
import board
import analogio
import neopixel
import rainbowio
analog_pin = analogio.AnalogIn(board.A0)
knob_pixel = neopixel.NeoPixel(board.D4, 1, brightness=0.75, auto_write=True)
analog_smoothing_buffer = []
def map_range(x, in_min, in_max, out_min, out_max):
return (x - in_min) / (in_max - in_min) * out_max - out_min
def average(values):
if not values:
return 0
return sum(values) / len(values)
while True:
analog_smoothing_buffer.insert(0, analog_pin.value)
if len(analog_smoothing_buffer) >= 10:
analog_smoothing_buffer.pop(-1)
knob_pixel[0] = rainbowio.colorwheel(
map_range(average(analog_smoothing_buffer), 0, 65525, 0, 255)
)

View file

@ -7,6 +7,7 @@ library example esp32spi_simpletest.py:
https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/
blob/master/examples/esp32spi_simpletest.py '''
from os import getenv
import board
import busio
from digitalio import DigitalInOut
@ -14,12 +15,17 @@ import adafruit_connection_manager
import adafruit_requests
from adafruit_esp32spi import adafruit_esp32spi
# Get wifi details and more from a secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
# Get WiFi details, ensure these are setup in settings.toml
ssid = getenv("CIRCUITPY_WIFI_SSID")
password = getenv("CIRCUITPY_WIFI_PASSWORD")
if None in [ssid, password]:
raise RuntimeError(
"WiFi settings are kept in settings.toml, "
"please add them there. The settings file must contain "
"'CIRCUITPY_WIFI_SSID', 'CIRCUITPY_WIFI_PASSWORD', "
"at a minimum."
)
print("Arduino Nano RP2040 Connect webclient test")
@ -46,16 +52,16 @@ print("Firmware vers.", esp.firmware_version)
print("MAC addr:", [hex(i) for i in esp.MAC_address])
for ap in esp.scan_networks():
print("\t%s\t\tRSSI: %d" % (str(ap['ssid'], 'utf-8'), ap['rssi']))
print("\t%s\t\tRSSI: %d" % (str(ap.ssid, 'utf-8'), ap.rssi))
print("Connecting to AP...")
while not esp.is_connected:
try:
esp.connect_AP(secrets["ssid"], secrets["password"])
esp.connect_AP(ssid, password)
except RuntimeError as e:
print("could not connect to AP, retrying: ", e)
continue
print("Connected to", str(esp.ssid, "utf-8"), "\tRSSI:", esp.rssi)
print("Connected to", str(esp.ap_info.ssid, "utf-8"), "\tRSSI:", esp.ap_info.rssi)
print("My IP address is", esp.pretty_ip(esp.ip_address))
print(

27564
Asteroid_Tracker/Arial-14.bdf Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

161
Asteroid_Tracker/code.py Normal file
View file

@ -0,0 +1,161 @@
# SPDX-FileCopyrightText: 2025 Liz Clark for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import os
import time
import ssl
import board
import wifi
import socketpool
import microcontroller
import displayio
from adafruit_display_text.bitmap_label import Label
from adafruit_bitmap_font import bitmap_font
import adafruit_imageload
from fourwire import FourWire
import adafruit_requests
from adafruit_gc9a01a import GC9A01A
from adafruit_ticks import ticks_ms, ticks_add, ticks_diff
cad_url = ("https://ssd-api.jpl.nasa.gov/cad.api?"
"des=2024%20YR4&body=ALL&"
"date-min=2030-01-01&date-max=2060-01-01")
sentry_url = "https://ssd-api.jpl.nasa.gov/sentry.api?des=2024%20YR4"
# connect to wifi
try:
wifi.radio.connect(os.getenv('CIRCUITPY_WIFI_SSID'), os.getenv('CIRCUITPY_WIFI_PASSWORD'))
except TypeError:
print("Could not find WiFi info. Check your settings.toml file!")
raise
context = ssl.create_default_context()
with open("/ssd-api-jpl-nasa-gov-chain.pem", "rb") as certfile:
context.load_verify_locations(cadata=certfile.read())
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, context)
spi = board.SPI()
tft_cs = board.TX
tft_dc = board.RX
tft_reset = None
displayio.release_displays()
display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_reset)
display = GC9A01A(display_bus, width=240, height=240, auto_refresh=False)
main_group = displayio.Group()
display.root_group = main_group
bitmap_bg, palette_bg = adafruit_imageload.load("/earth_bg.bmp",
bitmap=displayio.Bitmap,
palette=displayio.Palette)
grid_bg = displayio.TileGrid(bitmap_bg, pixel_shader=palette_bg)
main_group.append(grid_bg)
font = bitmap_font.load_font('/Arial-14.bdf')
name_area = Label(font, text="2024 YR4", color=0xFFFFFF, background_color=0x000000)
name_area.anchored_position = (display.width / 2, 0)
name_area.anchor_point = (0.5, 0.0)
date_area = Label(font, text="2032-12-22", color=0xFFFFFF, background_color=0x000000)
date_area.anchored_position = (display.width / 2, name_area.height+10)
date_area.anchor_point = (0.5, 0.0)
moon_area = Label(font, text="Moon: ", color=0xFFFFFF, background_color=0x000000)
moon_area.anchored_position = (display.width / 2, name_area.height+10 + date_area.height+5)
moon_area.anchor_point = (0.5, 0.0)
earth_area = Label(font, text="Earth: ", color=0xFFFFFF, background_color=0x000000)
earth_area.anchored_position = (display.width / 2, name_area.height+10 +
moon_area.height+5 +
date_area.height + 5)
earth_area.anchor_point = (0.5, 0.0)
impact_area = Label(font, text="Earth Impact: 0.0000%", color=0xFFFFFF, background_color=0x000000)
impact_area.anchored_position = (display.width / 2, name_area.height+10 +
moon_area.height+5 +
earth_area.height + 5 +
date_area.height + 5)
impact_area.anchor_point = (0.5, 0.0)
main_group.append(impact_area)
main_group.append(earth_area)
main_group.append(moon_area)
main_group.append(date_area)
main_group.append(name_area)
bit_asteroid, pal_asteroid = adafruit_imageload.load("/asteroid.bmp",
bitmap=displayio.Bitmap,
palette=displayio.Palette)
asteroid = displayio.TileGrid(bit_asteroid, pixel_shader=pal_asteroid,
x = 25, y=100)
pal_asteroid.make_transparent(0)
main_group.append(asteroid)
def diagonal_travel(bitmap_object, start_x=-59, start_y=-59, end_x=240, end_y=240, delay=0.01):
# Set initial position
bitmap_object.x = start_x
bitmap_object.y = start_y
# Calculate total movement distance
distance_x = end_x - start_x
distance_y = end_y - start_y
# Calculate number of steps (use the larger distance)
steps = max(abs(distance_x), abs(distance_y)) // 1
# Calculate step size for each axis to maintain diagonal movement
step_x = distance_x / steps
step_y = distance_y / steps
# Animate the movement
for i in range(steps + 1):
# Update position
bitmap_object.x = int(start_x + (step_x * i))
bitmap_object.y = int(start_y + (step_y * i))
display.refresh()
# Pause to control animation speed
time.sleep(delay)
def au_to_miles(au):
# 1 AU = 92,955,807 miles
miles_per_au = 92955807
return au * miles_per_au
timer_clock = ticks_ms()
timer = 3600 * 1000
first_run = True
while True:
try:
if first_run or ticks_diff(ticks_ms(), timer_clock) >= timer:
sentry_response = requests.get(sentry_url)
sentry_json = sentry_response.json()
impact = sentry_json['summary']['ip']
sentry_response.close()
overall_ip = float(impact) * 100
cad_response = requests.get(cad_url)
cad_json = cad_response.json()
earth_distance = au_to_miles(float(cad_json['data'][0][4]))
earth_area.text = f"{cad_json['data'][0][10]}: {int(earth_distance)} mi"
moon_distance = au_to_miles(float(cad_json['data'][1][4]))
moon_area.text = f"{cad_json['data'][1][10]}: {int(moon_distance)} mi"
date = cad_json['data'][0][3]
date = date.split()
date_area.text = f"{date[0]}"
cad_response.close()
impact_area.text = f"Earth Impact: {overall_ip:.4f}%"
display.refresh()
timer_clock = ticks_add(timer_clock, timer)
diagonal_travel(asteroid, start_x=-45, start_y=300, end_x=300, end_y=-45)
time.sleep(0.1)
# pylint: disable=broad-except
except Exception as e:
print("Error:\n", str(e))
print("Resetting microcontroller in 10 seconds")
time.sleep(10)
microcontroller.reset()

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View file

@ -0,0 +1,109 @@
-----BEGIN CERTIFICATE-----
MIIHRjCCBS6gAwIBAgIQV82HcwAIb4tFlHpCQCtGuzANBgkqhkiG9w0BAQsFADBR
MQswCQYDVQQGEwJVUzEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMSgwJgYDVQQD
DB9FbnRydXN0IE9WIFRMUyBJc3N1aW5nIFJTQSBDQSAxMB4XDTI1MDIwNTE0MDkw
MloXDTI2MDMwMzE0MTg1OFoweDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlm
b3JuaWExETAPBgNVBAcMCFBhc2FkZW5hMSIwIAYDVQQKDBlKZXQgUHJvcHVsc2lv
biBMYWJvcmF0b3J5MR0wGwYDVQQDDBRzc2QtYXBpLmpwbC5uYXNhLmdvdjCCASIw
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKXzsG9/H8CQzmmu1vwdM1RYrziS
8dzCuw2fqOJXfvOEB+jbZZGIPDvUXCqug0Gb+Z5MsbAdwxT8RsKRuWl/xgRZWr/Y
mtafmEIf3QeKy3/Hu2uUS1GQjTkfmY/3cj6szXJDF4YAC3lngFVWftmGrXhA1Dmm
WqApxguIf2XPjetKjcX1TMdC5XyQ/lsy/vJTX+S8G9HRk+OhO45kAf8AvVeCWCOa
XQ7jpEVBd610RGgD972XNazhoYtL2QKBm6GrSkx1rW/7aiPU0QLbkCoTJIno1yHn
nlYKVYWn0V1uG2vcuChhebX6WOHp7U6KAcaKVbTvaTxv8whi+t4gjcJRbgECAwEA
AaOCAvEwggLtMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUaA1FyjXC55ob8LOE
3dXafwuJwREwaAYIKwYBBQUHAQEEXDBaMDYGCCsGAQUFBzAChipodHRwOi8vY2Vy
dC5zc2wuY29tL0VudHJ1c3QtT1ZUTFMtSS1SMS5jZXIwIAYIKwYBBQUHMAGGFGh0
dHA6Ly9vY3Nwcy5zc2wuY29tMB8GA1UdEQQYMBaCFHNzZC1hcGkuanBsLm5hc2Eu
Z292MCMGA1UdIAQcMBowCAYGZ4EMAQICMA4GDCsGAQQBgqkwAQMBAjAdBgNVHSUE
FjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwOwYDVR0fBDQwMjAwoC6gLIYqaHR0cDov
L2NybHMuc3NsLmNvbS9FbnRydXN0LU9WVExTLUktUjEuY3JsMB0GA1UdDgQWBBQ9
28d7XB5zNhW4Z/FiFGVefv8TpDAOBgNVHQ8BAf8EBAMCBaAwggF/BgorBgEEAdZ5
AgQCBIIBbwSCAWsBaQB3AJaXZL9VWJet90OHaDcIQnfp8DrV9qTzNm5GpD8PyqnG
AAABlNZ6jp0AAAQDAEgwRgIhAM/xkbmguT7NTj3lc6p/F3Um9y7fDhYjzHhWvyDc
HIaQAiEAmRCNTCoJAOFtiXFseiUANEn16Wr3rW5cAUiAJ3mQPewAdwDLOPcViXyE
oURfW8Hd+8lu8ppZzUcKaQWFsMsUwxRY5wAAAZTWeo6SAAAEAwBIMEYCIQCExfjt
QsfbwEpS8cI3YNcXOAW3fMiAh6vOW2wD88iruwIhALfInWVFlobCtQYXLtXq2iqe
HO083hp/cD0oDIChPD9SAHUAZBHEbKQS7KeJHKICLgC8q08oB9QeNSer6v7VA8l9
zfAAAAGU1nqOzgAABAMARjBEAiBTSQczvVZCJ41l+JiC9n8fOkuYNf8jQ1uG5rKy
M/g6IwIgK7YZziGBfBHHKYR8e+IyitJktRevFehnGPEwbMNOO1wwDQYJKoZIhvcN
AQELBQADggIBAGCVD/1ROYGTKPhFeDUFiPjW7JKagsmldnWdtYQ7ran5Ozd8Hkju
XaEi/sDed8wHv1Bf8lesHd3dz2KlaefLVBknntOMSC7fxr7cvkHHgJyJbWtrOESF
JTuy13CdbIHZTxSRtVErCqumUC4omAOfffoGEMlcKvLlIK1NtZTibPsmeUVceMjI
1iZ6OeAOQfZHwlHk49r1zN2D41/5NOT6hpg1bP+rwp/ZhRpT0cB0Q+PBF/GeRCJp
fyLWng/yfILPl2EZoo2RJ0FbdM7VhxGK9359CbKpIPDrZAqagTafEvzRoL9afBAo
n/fht0RCmHiz56vmYo4a742Hwr1Hgempgx+UBlTluf7UGEJ3ju9JEgM/wY+Zc9wm
HyBcQjzPFcDMGGJo/cQwPNYOI06LePpvGiWLe/8WvW+MSPk19JEQj4uOf02Yowzj
1LXFvSzTase6AjrjiOPd57rgmwUKju+/ouX5qyOBbB4dKJ1Q7pOvb2wR+yF/2Mro
YJS73WJVK64mk6aletwcL0uy+vZiZlesBWIiERPR915NiDEeEYSXYtmwu0XhiS8b
jxpMbXIEuhRtA3c8WeqKCbuSnQs+8SMaYpHZ3QgwCreBWl25J5J4nPtW3tPgINkG
gKDVZyGsOJE4t/sQs7zoQAf4rX7eY+U4w+6CIE7XAkACI7Mug6kXOJZJ
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIGVjCCBD6gAwIBAgIQb+Y+3l/BwDr7bXqFvToVbTANBgkqhkiG9w0BAQsFADBO
MQswCQYDVQQGEwJVUzEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMSUwIwYDVQQD
DBxTU0wuY29tIFRMUyBSU0EgUm9vdCBDQSAyMDIyMB4XDTI0MDgyMjE3NTMzOFoX
DTI3MDgyMjE3NTMzN1owUTELMAkGA1UEBhMCVVMxGDAWBgNVBAoMD1NTTCBDb3Jw
b3JhdGlvbjEoMCYGA1UEAwwfRW50cnVzdCBPViBUTFMgSXNzdWluZyBSU0EgQ0Eg
MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKCL+NvDMIL3efFuNaQc
aYwzFpZQd/B6gkTd0s+Cu5jFu3Iw5qxis7xsRQWf739+ohRm42PYEiH7IjErxQAw
+jbLstW7HP7UaTDoYSN/IZ5mG0wHF/QLlAyXsGz9hNPPE31CN8xfA4JFH8jaQftN
QJJnRgWKFys3LK/U2YWbOkx4M50XHFsEDkAuwkt11vEzveJkglfd2O9srAhMsz21
YciZed5VQRncdFbY0hh/hbs9n9eRkmg/ItDOmvKbWiljXP7Pigl9mMJWfnqEJaUd
tt4FzpiizghGgTwGytDAUH7GxtiLdf3F/Vs5UhRUdEQEnm5Y1OVdjLb3CZpTc3vw
XViwO/jG7b64Ancehrrpagbj8yVXGk4Vh8Rj4nf99whmGGP+z9+9T5DXaWTF2xt9
PCbviJaIotT3XO7J2VGZyxnV85us4WVY7/vpCQgUEajsglaFW53UCD3uzuBUR3lW
YDWZvd7wiPg5wWhA6DXL//MKVQ0dvUJ03AI+zxUvYCDyhBPOEx9ojRgF7HOvq+wG
EvX6kV34e5ZLaeR0Wr8iaUq8Wl9oPB0vxuZdJMT4ewNHjLB6IFJY4cszBQBPmxMx
jnRkaDb7B/dlS/I2sjTyxB/n+CwbHbuiwkKqVVQpbYws7cmrkUjLQklqFO1xJrVI
Me3bAHHqOZeMfUYCo5gxrPCLAgMBAAGjggErMIIBJzASBgNVHRMBAf8ECDAGAQH/
AgEAMB8GA1UdIwQYMBaAFPsuN+7jhHonLs0ZNbEzfP/UREK5MEwGCCsGAQUFBwEB
BEAwPjA8BggrBgEFBQcwAoYwaHR0cDovL2NlcnQuc3NsLmNvbS9TU0xjb20tVExT
LVJvb3QtMjAyMi1SU0EuY2VyMBEGA1UdIAQKMAgwBgYEVR0gADAdBgNVHSUEFjAU
BggrBgEFBQcDAgYIKwYBBQUHAwEwQQYDVR0fBDowODA2oDSgMoYwaHR0cDovL2Ny
bHMuc3NsLmNvbS9TU0xjb20tVExTLVJvb3QtMjAyMi1SU0EuY3JsMB0GA1UdDgQW
BBRoDUXKNcLnmhvws4Td1dp/C4nBETAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcN
AQELBQADggIBABNdeusuCgNkxuATfOU8MHWeX7BYQA77yRx/fdV5rEMOdIRMRH/J
Ar7qQ+RH9SY4tqAwkfsKBNhgqZnjzeYOMmOVRTlOQpKJwMwZbX5M1IvuF45EF5BO
dwRBIMAqSxLzFV4CAS1LUEptuA6SGMC6thY4TdQoHN1YR5A/tFmPj9ASDxlqE7Wc
7ZkeL1R8NAKNbcYGPEUXAy9NMiIwwnTqJqQSQXAquf8rhOiOfqWoghMU1xUQ4VgO
aPPCbHCanTLWLLo6MEcHuVNdYvtTUmxixuTcqU2E+XfzUH0qoOskiwxAXncRaM+H
7diEROecsP9PQFui/ll7QmiEE4goazA72Mvk1IsL7+2gI9BrUgWGxGLOoCcJqvUg
Z/8K6N5UJZKXnjOL+tjQVk8qCcF818vuOtOvSAQUeOjSdb1QjaM18Fc62qyclga8
FIxqs4UPJg7ozHrCkPBUXb1MlUu0yf0Y9i8R9woh6S0k4TZGZKKKdxmS7QnF4D6M
Rr60DDCwdUKP5dMmqPsWd2qaBxlaS3wacNqjhdt0DbXmEOz18BRiKbRxaZ4sDxn9
O8XngqHUi9j5bulLTfQSqxDXuMwG0WjkqgkJaCujQ1zIZ7sSIcfGzBevRSy1R32Y
Wp1i1vr3oWsj+Cw9gr8FPEw/pPcW7GWfoJvpiHVQ99u7+vUqjQQ13ieL
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFiTCCA3GgAwIBAgIQb77arXO9CEDii02+1PdbkTANBgkqhkiG9w0BAQsFADBO
MQswCQYDVQQGEwJVUzEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMSUwIwYDVQQD
DBxTU0wuY29tIFRMUyBSU0EgUm9vdCBDQSAyMDIyMB4XDTIyMDgyNTE2MzQyMloX
DTQ2MDgxOTE2MzQyMVowTjELMAkGA1UEBhMCVVMxGDAWBgNVBAoMD1NTTCBDb3Jw
b3JhdGlvbjElMCMGA1UEAwwcU1NMLmNvbSBUTFMgUlNBIFJvb3QgQ0EgMjAyMjCC
AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANCkCXJPQIgSYT41I57u9nTP
L3tYPc48DRAokC+X94xI2KDYJbFMsBFMF3NQ0CJKY7uB0ylu1bUJPiYYf7ISf5OY
t6/wNr/y7hienDtSxUcZXXTzZGbVXcdotL8bHAajvI9AI7YexoS9UcQbOcGV0ins
S657Lb85/bRi3pZ7QcacoOAGcvvwB5cJOYF0r/c0WRFXCsJbwST0MXMwgsadugL3
PnxEX4MN8/HdIGkWCVDi1FW24IBydm5MR7d1VVm0U3TZlMZBrViKMWYPHqIbKUBO
L9975hYsLfy/7PO0+r4Y9ptJ1O4Fbtk085zx7AGL0SDGD6C1vBdOSHtRwvzpXGk3
R2azaPgVKPC506QVzFpPulJwoxJF3ca6TvvC0PeoUidtbnm1jPx7jMEWTO6Af77w
dr5BUxIzrlo4QqvXDz5BjXYHMtWrifZOZ9mxQnUjbvPNQrL8VfVThxc7wDNY8VLS
+YCk8OjwO4s4zKTGkH8PnP2L0aPP2oOnaclQNtVcBdIKQXTbYxE3waWglksejBYS
d66UNHsef8JmAOSqg+qKkK3ONkRN0VHpvB/zagX9wHQfJRlAUW7qglFA35u5CCoG
AtUjHBPW6dvbxrB6y3snm/vg1UYk7RBLY0ulBY+6uB0rpvqR4pJSvezrZ5dtmi2f
gTIFZzL7SAg/2SW4BCUvAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j
BBgwFoAU+y437uOEeicuzRk1sTN8/9REQrkwHQYDVR0OBBYEFPsuN+7jhHonLs0Z
NbEzfP/UREK5MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAjYlt
hEUY8U+zoO9opMAdrDC8Z2awms22qyIZZtM7QbUQnRC6cm4pJCAcAZli05bg4vsM
QtfhWsSWTVTNj8pDU/0quOr4ZcoBwq1gaAafORpR2eCNJvkLTqVTJXojpBzOCBvf
R4iyrT7gJ4eLSYwfqUdYe5byiB0YrrPRpgqU+tvT5TgKa3kSM/tKWTcWQA673vWJ
DPFs0/dRa1419dvAJuoSc06pkZCmF8NsLzjUo3KUQyxi4U5cMj29TH0ZR6LDSeeW
P4+a0zvkEdiLA9z2tmBVGKaBUfPhqBVq6+AL8BQx1rmMRTqoENjwuSfr98t67wVy
lrXEj5ZzxOhWc5y8aVFjvO9nHEMaX3cZHxj4HCUp+UmZKbaSPaKDN7EgkaibMOlq
bLQjk2UEqxHzDh1TJElTHaE/nUiSEeJ9DU/1172iWD54nR4fK/4huxoTtrEoZP2w
AgDHbICivRZQIA9ygV/MlP+7mea6kMvq+cYMwq7FGc4zoWtcu358NFcXrfA/rs3q
r5nsLFR+jM4uElZI7xc7P0peYNLcdDa8pUNjyw9bowJWCZ4kLOGGgYz+qxcs+sji
Mho6/4UIyYOf8kpIEFR3N+2ivEC+5BB09+Rbu7nzifmPQdjH5FCQNYA+HLhNkNPU
98OwoX6EyneSMSy4kLGCenROmxMmtNVQZlR4rmA=
-----END CERTIFICATE-----

View file

@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: 2022 Liz Clark for Adafruit Industries
# SPDX-License-Identifier: MIT
from os import getenv
import time
import json
import board
@ -38,15 +39,20 @@ nau7802 = NAU7802(board.STEMMA_I2C(), address=0x2A, active_channels=2)
nau7802.gain = 128
enabled = nau7802.enable(True)
# Get wifi details and more from a secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
# Get WiFi details, ensure these are setup in settings.toml
ssid = getenv("CIRCUITPY_WIFI_SSID")
password = getenv("CIRCUITPY_WIFI_PASSWORD")
if None in [ssid, password]:
raise RuntimeError(
"WiFi settings are kept in settings.toml, "
"please add them there. The settings file must contain "
"'CIRCUITPY_WIFI_SSID', 'CIRCUITPY_WIFI_PASSWORD', "
"at a minimum."
)
print("Connecting to WiFi...")
wifi.radio.connect(secrets["ssid"], secrets["password"])
wifi.radio.connect(ssid, password)
print("Connected to WiFi!")
# check system time
@ -65,7 +71,7 @@ else:
esp = None
pool = socketpool.SocketPool(wifi.radio)
device = IoTCentralDevice(
pool, esp, secrets['id_scope'], secrets['device_id'], secrets['device_primary_key']
pool, esp, getenv("id_scope"), getenv("device_id"), getenv("device_primary_key")
)
display.fill(0)
display.print("DIALING*")
@ -191,6 +197,8 @@ avg_oz = []
values = []
val_offset = 0
avg_values = []
the_ounces = 0
the_grams = 0
# initial reading from the scale
for w in range(5):

View file

View file

@ -0,0 +1,44 @@
// SPDX-FileCopyrightText: 2020 Phil Schatzmann
//
// SPDX-License-Identifier: GPL-3.0-or-later
/*
Streaming Music from Bluetooth
Copyright (C) 2020 Phil Schatzmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// ==> Example which shows how to use the built in ESP32 I2S >= 3.0.0
#include "ESP_I2S.h"
#include "BluetoothA2DPSink.h"
const uint8_t I2S_SCK = 8; /* Audio data bit clock */
const uint8_t I2S_WS = 7; /* Audio data left and right clock */
const uint8_t I2S_SDOUT = 14; /* ESP32 audio data output (to speakers) */
I2SClass i2s;
BluetoothA2DPSink a2dp_sink(i2s);
void setup() {
i2s.setPins(I2S_SCK, I2S_WS, I2S_SDOUT);
if (!i2s.begin(I2S_MODE_STD, 44100, I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_STEREO, I2S_STD_SLOT_BOTH)) {
Serial.println("Failed to initialize I2S!");
while (1); // do nothing
}
a2dp_sink.start("Lumon Industries Speaker");
}
void loop() {
}

View file

@ -0,0 +1,730 @@
// SPDX-FileCopyrightText: 2025 John Park for Adafruit Industries
//
// SPDX-License-Identifier: MIT
//
// made with assistance from Claude Sonnet 4
//
// Unified Bluetooth HID Bridge - BT Classic & BLE
// put keyboard in pairing mode, then press reset or BOOT button
// slow blinks mean scanning
// fast blinks mean keyboard detected, press a keyboard key to connect
// === CONFIGURATION ===
#define DEBUG_MODE false // Set to false to reduce serial output
#define BLINK_MODE true // Set to false for solid LED (no keypress blinks)
#define SCAN_MODE "Both" // Options: "BT_Classic", "BLE", "Both"
// Include both Bluetooth stacks
extern "C" {
#include "btstack.h"
}
#include <BluetoothHCI.h>
#include <BluetoothHIDMaster.h>
#include <Keyboard.h>
#include <Mouse.h>
// Connection state management
typedef enum {
INIT,
SCANNING_CLASSIC,
CLASSIC_CONNECTING,
CLASSIC_CONNECTED,
SCANNING_BLE,
BLE_CONNECTED,
BOTH_FAILED,
DISCONNECTED
} connection_state_t;
connection_state_t connection_state = INIT;
// BT Classic components
BluetoothHCI hci;
bd_addr_t target_keyboard_addr;
bool target_keyboard_found = false;
uint16_t hid_control_cid = 0;
uint16_t hid_interrupt_cid = 0;
static btstack_packet_callback_registration_t hci_event_callback_registration;
// BLE components
BluetoothHIDMaster ble_hid;
HIDKeyStream keystream;
// Shared state tracking
static uint8_t last_modifiers = 0;
static uint8_t last_keys[6] = {0};
bool keyPressed[256] = {0}; // Track which keys are currently pressed
// LED management
unsigned long ledTimer = 0;
bool ledState = false;
unsigned long ledOffTime = 0;
bool ledBlinking = false;
int pairingBlinks = 0;
unsigned long pairingBlinkTimer = 0;
// Timing management
unsigned long lastScan = 0;
unsigned long stateStartTime = 0;
const unsigned long CLASSIC_SCAN_TIMEOUT = 10000; // 10 seconds
const unsigned long BLE_SCAN_TIMEOUT = 15000; // 15 seconds
void setup() {
Serial.begin(115200);
delay(3000);
Serial.println("=== UNIFIED BLUETOOTH HID BRIDGE ===");
Serial.printf("Scan mode: %s\n", SCAN_MODE);
Serial.println("Put your Bluetooth device in pairing mode now");
// Initialize LED
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
Serial.println("LED initialized");
// Initialize USB HID
Keyboard.begin();
Mouse.begin();
Serial.println("USB HID initialized");
// Start with LED blinking to show we're alive
ledTimer = millis();
ledState = true;
digitalWrite(LED_BUILTIN, HIGH);
Serial.println("Starting Bluetooth stack initialization...");
// Choose scan mode based on user setting
if (strcmp(SCAN_MODE, "BT_Classic") == 0) {
Serial.println("BT Classic only mode");
connection_state = SCANNING_CLASSIC;
stateStartTime = millis();
initAndScanClassic();
} else if (strcmp(SCAN_MODE, "BLE") == 0) {
Serial.println("BLE only mode");
connection_state = SCANNING_BLE;
stateStartTime = millis();
initAndScanBLE();
} else {
Serial.println("Both protocols mode - trying Classic first");
connection_state = SCANNING_CLASSIC;
stateStartTime = millis();
initAndScanClassic();
}
}
void initAndScanClassic() {
Serial.println("\n=== INITIALIZING BT CLASSIC STACK ===");
// Initialize HCI for Classic
l2cap_init();
sm_init();
gap_set_default_link_policy_settings(LM_LINK_POLICY_ENABLE_SNIFF_MODE | LM_LINK_POLICY_ENABLE_ROLE_SWITCH);
hci_set_master_slave_policy(HCI_ROLE_MASTER);
hci_set_inquiry_mode(INQUIRY_MODE_RSSI_AND_EIR);
Serial.println("BTStack components initialized");
hci.install();
hci.begin();
Serial.println("HCI installed and started");
// Register BTStack event handler
hci_event_callback_registration.callback = &classic_packet_handler;
hci_add_event_handler(&hci_event_callback_registration);
Serial.println("Event handler registered");
// Turn on Bluetooth
hci_power_control(HCI_POWER_ON);
Serial.println("Bluetooth power ON");
delay(2000); // Give it time to initialize
Serial.println("Starting BT Classic device scan...");
scanForClassicDevices();
}
void scanForClassicDevices() {
Serial.println("Scanning for BT Classic devices...");
auto devices = hci.scan(BluetoothHCI::any_cod);
Serial.printf("Classic scan completed. Found %d devices:\n", devices.size());
if (devices.size() == 0) {
Serial.println("No Classic devices found. Will try BLE after timeout.");
return;
}
Serial.println("Address | RSSI | Class | Name");
Serial.println("------------------|------|----------|------------------");
for (auto device : devices) {
uint32_t cod = device.deviceClass();
uint8_t majorClass = (cod >> 8) & 0x1F;
uint8_t minorClass = (cod >> 2) & 0x3F;
Serial.printf("%s | %4d | %08lx | %s",
device.addressString(), device.rssi(), cod, device.name());
// Look for HID keyboards in Classic scan
if (majorClass == 5 && (minorClass & 0x10)) { // HID Keyboard
Serial.print(" [HID KEYBOARD] *** CONNECTING ***");
// We found a Classic keyboard!
const char* addrStr = device.addressString();
sscanf(addrStr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
&target_keyboard_addr[0], &target_keyboard_addr[1], &target_keyboard_addr[2],
&target_keyboard_addr[3], &target_keyboard_addr[4], &target_keyboard_addr[5]);
target_keyboard_found = true;
Serial.printf("\nFound Classic HID keyboard: %s\n", device.name());
Serial.printf("Address: %s\n", device.addressString());
// Start Classic connection
connection_state = CLASSIC_CONNECTING;
stateStartTime = millis();
startClassicConnection();
Serial.println();
return; // Exit the loop - we found our keyboard
} else {
// Show device type for debugging
switch (majorClass) {
case 1: Serial.print(" [Computer]"); break;
case 2: Serial.print(" [Phone]"); break;
case 3: Serial.print(" [Network]"); break;
case 4: Serial.print(" [Audio/Video]"); break;
case 5: Serial.print(" [HID Device]"); break;
default: Serial.printf(" [Class:%d]", majorClass); break;
}
}
Serial.println();
}
Serial.println("No HID keyboards found in Classic scan.");
}
void fallbackToBLE() {
Serial.println("\n=== FALLING BACK TO BLE ===");
connection_state = SCANNING_BLE;
stateStartTime = millis();
initAndScanBLE();
}
void initAndScanBLE() {
Serial.println("Initializing BLE stack...");
// Setup the HID key to ASCII conversion
keystream.begin();
Serial.println("KeyStream initialized");
// Setup BLE callbacks
setupBLECallbacks();
Serial.println("BLE callbacks configured");
// Start BLE HID master
ble_hid.begin(true);
Serial.println("BLE HID master started");
// Start BLE connection attempt
ble_hid.connectBLE();
Serial.println("BLE connection initiated - waiting for device...");
Serial.println("(BLE devices will be detected on first keypress)");
}
void setupBLECallbacks() {
// BLE Mouse callbacks
ble_hid.onMouseMove([](void *cbdata, int dx, int dy, int dw) {
(void) cbdata;
if (DEBUG_MODE) {
Serial.printf("BLE Mouse: X:%d Y:%d Wheel:%d\n", dx, dy, dw);
}
Mouse.move(dx, dy);
if (dw != 0) Mouse.move(0, 0, dw);
blinkOnActivity();
});
ble_hid.onMouseButton([](void *cbdata, int butt, bool down) {
(void) cbdata;
if (DEBUG_MODE) {
Serial.printf("BLE Mouse: Button %d %s\n", butt, down ? "DOWN" : "UP");
}
if (down) {
if (butt == 1) Mouse.press(MOUSE_LEFT);
else if (butt == 2) Mouse.press(MOUSE_RIGHT);
else if (butt == 3) Mouse.press(MOUSE_MIDDLE);
} else {
if (butt == 1) Mouse.release(MOUSE_LEFT);
else if (butt == 2) Mouse.release(MOUSE_RIGHT);
else if (butt == 3) Mouse.release(MOUSE_MIDDLE);
}
blinkOnActivity();
});
// BLE Keyboard callbacks
ble_hid.onKeyDown([](void *cbdata, int key) {
handleBLEKey(key, true);
}, (void *)true);
ble_hid.onKeyUp([](void *cbdata, int key) {
handleBLEKey(key, false);
}, (void *)false);
}
void startClassicConnection() {
if (!target_keyboard_found) {
Serial.println("ERROR: No Classic target keyboard found");
fallbackToBLE();
return;
}
Serial.println("=== STARTING CLASSIC HID CONNECTION ===");
Serial.println("Creating L2CAP Control channel...");
// Create control channel first
l2cap_create_channel(&classic_packet_handler, target_keyboard_addr, BLUETOOTH_PSM_HID_CONTROL,
48, &hid_control_cid);
}
void handleBLEKey(int key, bool state) {
if (DEBUG_MODE) {
Serial.printf("BLE Keyboard: %02x %s\n", key, state ? "DOWN" : "UP");
}
if (key >= 256) return; // Bounds check
// Check if this is the first BLE key press (connection detection)
if (connection_state == SCANNING_BLE) {
Serial.printf("\n*** BLE KEYBOARD DETECTED ON FIRST KEYPRESS ***\n");
Serial.printf("=== BLE DEVICE CONNECTED ===\n");
Serial.printf("Ready to forward BLE input to USB.\n");
Serial.printf("========================\n");
connection_state = BLE_CONNECTED;
celebrationBlinks(8); // 4 blinks for BLE
// After celebration, LED will go solid (handled in LED patterns)
}
// Forward the key to USB
forwardBLEKeyToUSB(key, state);
blinkOnActivity();
}
void classic_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) {
UNUSED(size);
if (packet_type == HCI_EVENT_PACKET) {
uint8_t event = hci_event_packet_get_type(packet);
switch (event) {
case BTSTACK_EVENT_STATE:
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING) {
Serial.println("Classic BTstack ready");
}
break;
case L2CAP_EVENT_CHANNEL_OPENED:
{
uint16_t cid = l2cap_event_channel_opened_get_local_cid(packet);
uint16_t psm = l2cap_event_channel_opened_get_psm(packet);
uint8_t status = l2cap_event_channel_opened_get_status(packet);
if (status) {
Serial.printf("Classic L2CAP connection failed, status 0x%02x\n", status);
handleClassicConnectionError(status);
return;
}
Serial.printf("Classic L2CAP channel opened: CID=0x%04x, PSM=0x%04x\n", cid, psm);
if (psm == BLUETOOTH_PSM_HID_CONTROL) {
hid_control_cid = cid;
Serial.println("Classic HID Control channel established");
Serial.println("Creating L2CAP Interrupt channel...");
// Create interrupt channel
l2cap_create_channel(&classic_packet_handler, target_keyboard_addr, BLUETOOTH_PSM_HID_INTERRUPT,
48, &hid_interrupt_cid);
} else if (psm == BLUETOOTH_PSM_HID_INTERRUPT) {
hid_interrupt_cid = cid;
Serial.println("Classic HID Interrupt channel established");
Serial.println("*** CLASSIC HID CONNECTION COMPLETE ***");
connection_state = CLASSIC_CONNECTED;
celebrationBlinks(6); // 3 blinks for Classic
// After celebration, LED will go solid (handled in LED patterns)
}
}
break;
case L2CAP_EVENT_CHANNEL_CLOSED:
{
uint16_t cid = l2cap_event_channel_closed_get_local_cid(packet);
Serial.printf("Classic L2CAP channel closed: CID=0x%04x\n", cid);
if (cid == hid_control_cid) {
hid_control_cid = 0;
} else if (cid == hid_interrupt_cid) {
hid_interrupt_cid = 0;
}
if (hid_control_cid == 0 && hid_interrupt_cid == 0) {
Serial.println("Classic HID connection lost.");
connection_state = DISCONNECTED;
target_keyboard_found = false;
}
}
break;
default:
break;
}
} else if (packet_type == L2CAP_DATA_PACKET) {
// Classic HID input data
if (channel == hid_interrupt_cid) {
if (DEBUG_MODE) {
Serial.printf("Classic HID Input Data (%d bytes): ", size);
for (int i = 0; i < size; i++) {
Serial.printf("%02X ", packet[i]);
}
Serial.println();
}
processClassicHIDReport(packet, size);
}
}
}
void handleClassicConnectionError(uint8_t status) {
Serial.printf("Classic connection failed with status 0x%02x - ", status);
switch (status) {
case 0x04: Serial.println("Page timeout"); break;
case 0x05: Serial.println("Authentication failure"); break;
case 0x08: Serial.println("Connection timeout"); break;
default: Serial.printf("Error code 0x%02x\n", status); break;
}
Serial.println("Trying BLE fallback...");
fallbackToBLE();
}
void processClassicHIDReport(uint8_t *report, uint16_t length) {
if (length < 10) {
Serial.printf("Invalid Classic HID report length: %d\n", length);
return;
}
uint8_t modifiers = report[2];
uint8_t *keys = &report[4];
// Forward to USB HID
forwardClassicToUSB(modifiers, keys);
blinkOnActivity();
}
// Shared key mapping function
uint8_t hidToUsbKey(uint8_t hidKey) {
switch (hidKey) {
// Letters
case 0x04: return 'a'; case 0x05: return 'b'; case 0x06: return 'c'; case 0x07: return 'd';
case 0x08: return 'e'; case 0x09: return 'f'; case 0x0A: return 'g'; case 0x0B: return 'h';
case 0x0C: return 'i'; case 0x0D: return 'j'; case 0x0E: return 'k'; case 0x0F: return 'l';
case 0x10: return 'm'; case 0x11: return 'n'; case 0x12: return 'o'; case 0x13: return 'p';
case 0x14: return 'q'; case 0x15: return 'r'; case 0x16: return 's'; case 0x17: return 't';
case 0x18: return 'u'; case 0x19: return 'v'; case 0x1A: return 'w'; case 0x1B: return 'x';
case 0x1C: return 'y'; case 0x1D: return 'z';
// Numbers
case 0x1E: return '1'; case 0x1F: return '2'; case 0x20: return '3'; case 0x21: return '4';
case 0x22: return '5'; case 0x23: return '6'; case 0x24: return '7'; case 0x25: return '8';
case 0x26: return '9'; case 0x27: return '0';
// Special keys
case 0x28: return KEY_RETURN; case 0x29: return KEY_ESC;
case 0x2A: return KEY_BACKSPACE; case 0x2B: return KEY_TAB;
case 0x2C: return ' '; case 0x39: return KEY_CAPS_LOCK;
// Symbols
case 0x2D: return '-'; case 0x2E: return '='; case 0x2F: return '['; case 0x30: return ']';
case 0x31: return '\\'; case 0x33: return ';'; case 0x34: return '\''; case 0x35: return '`';
case 0x36: return ','; case 0x37: return '.'; case 0x38: return '/';
// Function keys
case 0x3A: return KEY_F1; case 0x3B: return KEY_F2; case 0x3C: return KEY_F3;
case 0x3D: return KEY_F4; case 0x3E: return KEY_F5; case 0x3F: return KEY_F6;
case 0x40: return KEY_F7; case 0x41: return KEY_F8; case 0x42: return KEY_F9;
case 0x43: return KEY_F10; case 0x44: return KEY_F11; case 0x45: return KEY_F12;
// Arrow keys
case 0x4F: return KEY_RIGHT_ARROW; case 0x50: return KEY_LEFT_ARROW;
case 0x51: return KEY_DOWN_ARROW; case 0x52: return KEY_UP_ARROW;
// Navigation
case 0x49: return KEY_INSERT; case 0x4A: return KEY_HOME;
case 0x4B: return KEY_PAGE_UP; case 0x4C: return KEY_DELETE;
case 0x4D: return KEY_END; case 0x4E: return KEY_PAGE_DOWN;
// Modifiers
case 0xE0: return KEY_LEFT_CTRL; case 0xE1: return KEY_LEFT_SHIFT;
case 0xE2: return KEY_LEFT_ALT; case 0xE3: return KEY_LEFT_GUI;
case 0xE4: return KEY_RIGHT_CTRL; case 0xE5: return KEY_RIGHT_SHIFT;
case 0xE6: return KEY_RIGHT_ALT; case 0xE7: return KEY_RIGHT_GUI;
default: return 0;
}
}
void forwardClassicToUSB(uint8_t modifiers, uint8_t *keys) {
// Handle modifier changes
uint8_t modifier_changes = modifiers ^ last_modifiers;
// Process each modifier bit
if (modifier_changes & 0x01) (modifiers & 0x01) ? Keyboard.press(KEY_LEFT_CTRL) : Keyboard.release(KEY_LEFT_CTRL);
if (modifier_changes & 0x02) (modifiers & 0x02) ? Keyboard.press(KEY_LEFT_SHIFT) : Keyboard.release(KEY_LEFT_SHIFT);
if (modifier_changes & 0x04) (modifiers & 0x04) ? Keyboard.press(KEY_LEFT_ALT) : Keyboard.release(KEY_LEFT_ALT);
if (modifier_changes & 0x08) (modifiers & 0x08) ? Keyboard.press(KEY_LEFT_GUI) : Keyboard.release(KEY_LEFT_GUI);
if (modifier_changes & 0x10) (modifiers & 0x10) ? Keyboard.press(KEY_RIGHT_CTRL) : Keyboard.release(KEY_RIGHT_CTRL);
if (modifier_changes & 0x20) (modifiers & 0x20) ? Keyboard.press(KEY_RIGHT_SHIFT) : Keyboard.release(KEY_RIGHT_SHIFT);
if (modifier_changes & 0x40) (modifiers & 0x40) ? Keyboard.press(KEY_RIGHT_ALT) : Keyboard.release(KEY_RIGHT_ALT);
if (modifier_changes & 0x80) (modifiers & 0x80) ? Keyboard.press(KEY_RIGHT_GUI) : Keyboard.release(KEY_RIGHT_GUI);
// Handle key releases
for (int i = 0; i < 6; i++) {
if (last_keys[i] != 0) {
bool still_pressed = false;
for (int j = 0; j < 6; j++) {
if (keys[j] == last_keys[i]) {
still_pressed = true;
break;
}
}
if (!still_pressed) {
uint8_t usb_key = hidToUsbKey(last_keys[i]);
if (usb_key != 0) Keyboard.release(usb_key);
}
}
}
// Handle key presses
for (int i = 0; i < 6; i++) {
if (keys[i] != 0) {
bool already_pressed = false;
for (int j = 0; j < 6; j++) {
if (last_keys[j] == keys[i]) {
already_pressed = true;
break;
}
}
if (!already_pressed) {
uint8_t usb_key = hidToUsbKey(keys[i]);
if (usb_key != 0) Keyboard.press(usb_key);
}
}
}
// Save current state
last_modifiers = modifiers;
memcpy(last_keys, keys, 6);
}
void forwardBLEKeyToUSB(int key, bool state) {
if (key >= 256) return;
bool isModifier = (key >= 0xE0 && key <= 0xE7);
if (isModifier) {
uint8_t usbKey = hidToUsbKey(key);
if (state) Keyboard.press(usbKey);
else Keyboard.release(usbKey);
return;
}
// Handle regular keys
uint8_t usbKey = hidToUsbKey(key);
if (usbKey != 0) {
if (state && !keyPressed[key]) {
keyPressed[key] = true;
Keyboard.press(usbKey);
} else if (!state && keyPressed[key]) {
keyPressed[key] = false;
Keyboard.release(usbKey);
}
}
}
void celebrationBlinks(int count) {
pairingBlinks = count;
pairingBlinkTimer = millis();
digitalWrite(LED_BUILTIN, HIGH);
}
void blinkOnActivity() {
if (BLINK_MODE && pairingBlinks == 0 && (connection_state == CLASSIC_CONNECTED || connection_state == BLE_CONNECTED)) {
digitalWrite(LED_BUILTIN, LOW); // Turn OFF briefly to show activity
ledBlinking = true;
ledOffTime = millis() + 50; // Stay off for 50ms
}
}
void loop() {
unsigned long currentTime = millis();
// Handle state timeouts
handleStateTimeouts(currentTime);
// Handle LED patterns
handleLEDPatterns(currentTime);
// Handle BOOTSEL button
handleBootselButton();
delay(10);
}
void handleStateTimeouts(unsigned long currentTime) {
switch (connection_state) {
case SCANNING_CLASSIC:
if (currentTime - stateStartTime > CLASSIC_SCAN_TIMEOUT) {
if (strcmp(SCAN_MODE, "BT_Classic") == 0) {
Serial.println("Classic scan timeout - BT Classic only mode, retrying...");
stateStartTime = currentTime;
scanForClassicDevices(); // Retry Classic scan
} else {
Serial.println("Classic scan timeout - falling back to BLE");
fallbackToBLE();
}
}
break;
case SCANNING_BLE:
if (currentTime - stateStartTime > BLE_SCAN_TIMEOUT) {
if (strcmp(SCAN_MODE, "BLE") == 0) {
Serial.println("BLE scan timeout - BLE only mode, retrying...");
stateStartTime = currentTime;
initAndScanBLE(); // Retry BLE scan
} else {
Serial.println("BLE scan timeout - restarting from Classic");
connection_state = BOTH_FAILED;
stateStartTime = currentTime;
}
}
break;
case BOTH_FAILED:
if (currentTime - stateStartTime > 5000) { // Wait 5 seconds before retry
Serial.println("Retrying scan sequence...");
connection_state = SCANNING_CLASSIC;
stateStartTime = currentTime;
initAndScanClassic();
}
break;
}
}
void handleLEDPatterns(unsigned long currentTime) {
// Handle pairing celebration blinks first
if (pairingBlinks > 0) {
if (currentTime - pairingBlinkTimer >= 150) {
pairingBlinks--;
bool state = (pairingBlinks % 2 == 0);
digitalWrite(LED_BUILTIN, state);
pairingBlinkTimer = currentTime;
}
return;
}
// Handle activity blinks
if (ledBlinking && currentTime >= ledOffTime) {
digitalWrite(LED_BUILTIN, HIGH); // Turn back ON after brief off period
ledBlinking = false;
return;
}
// Handle state-based LED patterns
switch (connection_state) {
case SCANNING_CLASSIC:
case SCANNING_BLE:
// Slow blink while scanning (1 second cycle)
if (currentTime - ledTimer >= 1000) {
ledState = !ledState;
digitalWrite(LED_BUILTIN, ledState);
ledTimer = currentTime;
}
break;
case CLASSIC_CONNECTING:
// Fast blink while connecting - tells user to press a key
if (currentTime - ledTimer >= 250) {
ledState = !ledState;
digitalWrite(LED_BUILTIN, ledState);
ledTimer = currentTime;
}
break;
case CLASSIC_CONNECTED:
case BLE_CONNECTED:
// Solid ON while connected (unless doing activity blinks)
if (!ledBlinking) {
digitalWrite(LED_BUILTIN, HIGH);
}
break;
case BOTH_FAILED:
case DISCONNECTED:
// Very slow pulse when failed/disconnected (2 second cycle)
if (currentTime - ledTimer >= 2000) {
ledState = !ledState;
digitalWrite(LED_BUILTIN, ledState);
ledTimer = currentTime;
}
break;
}
}
void handleBootselButton() {
if (BOOTSEL) {
while (BOOTSEL) delay(1);
Serial.println("\nBOOTSEL pressed - restarting scan sequence");
// Clean up current connections
if (connection_state == CLASSIC_CONNECTED) {
if (hid_control_cid) l2cap_disconnect(hid_control_cid);
if (hid_interrupt_cid) l2cap_disconnect(hid_interrupt_cid);
} else if (connection_state == BLE_CONNECTED) {
ble_hid.disconnect();
ble_hid.clearPairing();
}
// Reset all state
Keyboard.releaseAll();
Mouse.release(MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE);
for (int i = 0; i < 256; i++) keyPressed[i] = false;
memset(last_keys, 0, 6);
last_modifiers = 0;
target_keyboard_found = false;
hid_control_cid = 0;
hid_interrupt_cid = 0;
pairingBlinks = 0;
ledBlinking = false;
// Restart from appropriate scan mode
if (strcmp(SCAN_MODE, "BT_Classic") == 0) {
connection_state = SCANNING_CLASSIC;
Serial.println("Restarting BT Classic scan...");
initAndScanClassic();
} else if (strcmp(SCAN_MODE, "BLE") == 0) {
connection_state = SCANNING_BLE;
Serial.println("Restarting BLE scan...");
initAndScanBLE();
} else {
connection_state = SCANNING_CLASSIC;
Serial.println("Restarting unified scan...");
initAndScanClassic();
}
}
}

View file

@ -22,31 +22,17 @@ clue.pixel.fill(0) # turn off NeoPixel
clue_display = displayio.Group()
# draw the dry plant
dry_plant_file = open("dry.bmp", "rb")
dry_plant_bmp = displayio.OnDiskBitmap(dry_plant_file)
# CircuitPython 6 & 7 compatible
dry_plant_bmp = displayio.OnDiskBitmap("dry.bmp")
dry_plant_sprite = displayio.TileGrid(
dry_plant_bmp,
pixel_shader=getattr(dry_plant_bmp, "pixel_shader", displayio.ColorConverter()),
dry_plant_bmp, pixel_shader=dry_plant_bmp.pixel_shader
)
# CircuitPython 7 compatible
# dry_plant_sprite = displayio.TileGrid(
# dry_plant_bmp, pixel_shader=dry_plant_bmp.pixel_shader
# )
clue_display.append(dry_plant_sprite)
# draw the happy plant on top (so it can be moved out of the way when needed)
happy_plant_file = open("happy.bmp", "rb")
happy_plant_bmp = displayio.OnDiskBitmap(happy_plant_file)
# CircuitPython 6 & 7 compatible
happy_plant_bmp = displayio.OnDiskBitmap("happy.bmp")
happy_plant_sprite = displayio.TileGrid(
happy_plant_bmp,
pixel_shader=getattr(happy_plant_bmp, "pixel_shader", displayio.ColorConverter()),
happy_plant_bmp, pixel_shader=happy_plant_bmp.pixel_shader
)
# CircuitPython 7 compatible
# happy_plant_sprite = displayio.TileGrid(
# happy_plant_bmp, pixel_shader=happy_plant_bmp.pixel_shader
# )
clue_display.append(happy_plant_sprite)
# Create text

View file

@ -5,6 +5,7 @@ import time
import board
import terminalio
import displayio
import i2cdisplaybus
from digitalio import DigitalInOut
from adafruit_mcp2515.canio import Message, RemoteTransmissionRequest
from adafruit_mcp2515 import MCP2515 as CAN
@ -15,7 +16,7 @@ displayio.release_displays()
i2c = board.STEMMA_I2C()
# STEMMA OLED setup
display_bus = displayio.I2CDisplay(i2c, device_address=0x3D, reset=None)
display_bus = i2cdisplaybus.I2CDisplayBus(i2c, device_address=0x3D, reset=None)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=64)
cs = DigitalInOut(board.A3)

0
CLUE_Altimeter/code.py → CLUE/CLUE_Altimeter/code.py Executable file → Normal file
View file

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

0
CLUE_Beacon/bg.bmp → CLUE/CLUE_Beacon/bg.bmp Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View file

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View file

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View file

@ -22,32 +22,14 @@ splash = displayio.Group()
# bad egg
BAD_EGG_FILENAME = "broken_egg.bmp"
# CircuitPython 6 & 7 compatible
begg_file = open(BAD_EGG_FILENAME, "rb")
begg_bmp = displayio.OnDiskBitmap(begg_file)
begg_sprite = displayio.TileGrid(
begg_bmp,
pixel_shader=getattr(begg_bmp, 'pixel_shader', displayio.ColorConverter())
)
# # CircuitPython 7+ compatible
# begg_bmp = displayio.OnDiskBitmap(BAD_EGG_FILENAME)
# begg_sprite = displayio.TileGrid(begg_bmp, pixel_shader=begg_bmp.pixel_shader)
begg_bmp = displayio.OnDiskBitmap(BAD_EGG_FILENAME)
begg_sprite = displayio.TileGrid(begg_bmp, pixel_shader=begg_bmp.pixel_shader)
# good egg
GOOD_EGG_FILENAME = "good_egg.bmp"
# CircuitPython 6 & 7 compatible
gegg_file = open(GOOD_EGG_FILENAME, "rb")
gegg_bmp = displayio.OnDiskBitmap(gegg_file)
gegg_sprite = displayio.TileGrid(
gegg_bmp,
pixel_shader=getattr(gegg_bmp, 'pixel_shader', displayio.ColorConverter())
)
# # CircuitPython 7+ compatible
# gegg_bmp = displayio.OnDiskBitmap(GOOD_EGG_FILENAME)
# gegg_sprite = displayio.TileGrid(gegg_bmp, pixel_shader=gegg_bmp.pixel_shader)
gegg_bmp = displayio.OnDiskBitmap(GOOD_EGG_FILENAME)
gegg_sprite = displayio.TileGrid(gegg_bmp, pixel_shader=gegg_bmp.pixel_shader)
# draw the bad egg!
splash.append(begg_sprite)

View file

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View file

@ -21,39 +21,19 @@ clue_display = displayio.Group()
# draw the background image
WASH_ON_FILENAME = "wash_on.bmp"
# CircuitPython 6 & 7 compatible
wash_on_file = open(WASH_ON_FILENAME, "rb")
wash_on_bmp = displayio.OnDiskBitmap(wash_on_file)
wash_on_sprite = displayio.TileGrid(
wash_on_bmp,
pixel_shader=getattr(wash_on_bmp, 'pixel_shader', displayio.ColorConverter())
)
# # CircuitPython 7+ compatible
# wash_on_bmp = displayio.OnDiskBitmap(WASH_ON_FILENAME)
# wash_on_sprite = displayio.TileGrid(wash_on_bmp, pixel_shader=wash_on_bmp.pixel_shader)
wash_on_bmp = displayio.OnDiskBitmap(WASH_ON_FILENAME)
wash_on_sprite = displayio.TileGrid(wash_on_bmp, pixel_shader=wash_on_bmp.pixel_shader)
clue_display.append(wash_on_sprite)
# draw the foreground image
WASH_OFF_FILENAME = "wash_off.bmp"
# CircuitPython 6 & 7 compatible
wash_off_file = open(WASH_OFF_FILENAME, "rb")
wash_off_bmp = displayio.OnDiskBitmap(wash_off_file)
wash_off_sprite = displayio.TileGrid(
wash_off_bmp,
pixel_shader=getattr(wash_off_bmp, 'pixel_shader', displayio.ColorConverter())
)
# # CircuitPython 7+ compatible
# wash_off_bmp = displayio.OnDiskBitmap(WASH_OFF_FILENAME)
# wash_off_sprite = displayio.TileGrid(wash_off_bmp, pixel_shader=wash_off_bmp.pixel_shader)
wash_off_bmp = displayio.OnDiskBitmap(WASH_OFF_FILENAME)
wash_off_sprite = displayio.TileGrid(wash_off_bmp, pixel_shader=wash_off_bmp.pixel_shader)
clue_display.append(wash_off_sprite)
# Create text
# first create the group
text_group = displayio.Group()

View file

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View file

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View file

View file

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View file

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

View file

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 169 KiB

After

Width:  |  Height:  |  Size: 169 KiB

Some files were not shown because too many files have changed in this diff Show more