This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| os.environ["PYTHONWARNINGS"] = "ignore" | |
| import warnings | |
| warnings.filterwarnings("ignore") | |
| import speech_recognition as sr | |
| import subprocess | |
| def play_song(song_name): | |
| script_content = f"""#!/bin/bash | |
| yt-dlp --no-playlist -x --audio-format wav -o - --quiet "ytsearch1:{song_name}" | ffmpeg -i - -f s16le -ar 48000 -ac 2 - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import speech_recognition as sr | |
| import pygame | |
| # Initialize recognizer | |
| recognizer = sr.Recognizer() | |
| # Initialize Pygame | |
| pygame.init() | |
| screen_width = 1024 | |
| screen_height = 600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import board | |
| import neopixel | |
| from digitalio import DigitalInOut, Direction, Pull | |
| import touchio | |
| touch_pad = board.A0 # the ~1 pin | |
| touch = touchio.TouchIn(touch_pad) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import board | |
| import neopixel | |
| from digitalio import DigitalInOut, Direction, Pull | |
| import touchio | |
| touch_pad = board.A0 # the ~1 pin | |
| touch = touchio.TouchIn(touch_pad) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import board | |
| import neopixel | |
| from digitalio import DigitalInOut, Direction, Pull | |
| import touchio | |
| touch_pad = board.A0 # the ~1 pin | |
| touch = touchio.TouchIn(touch_pad) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import board | |
| import neopixel | |
| from digitalio import DigitalInOut, Direction, Pull | |
| import touchio | |
| touch_pad = board.A0 # the ~1 pin | |
| touch = touchio.TouchIn(touch_pad) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import board | |
| import neopixel | |
| from digitalio import DigitalInOut, Direction, Pull | |
| import touchio | |
| touch_pad = board.A0 # the ~1 pin | |
| touch = touchio.TouchIn(touch_pad) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import board | |
| import neopixel | |
| import time | |
| pixel_pin = board.D2 #the ring data is connected to this pin | |
| num_pixels = 16 #number of leds pixels on the ring | |
| pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.3, auto_write=False) | |
| RED = (255, 0, 0) #RGB |