Published © CC BY-NC-SA

The Mask of Mentions

A delightful oddity turned into a Discord fuelled spreader of gloom!

BeginnerFull instructions provided8 hours241
The Mask of Mentions

Things used in this project

Hardware components

Mask
×1
Raspberry Pi Zero Wireless Starter Kit
×1
Adafruit NeoPixel Ring - 16 x
×1
Duct Tape
×1
Jumper WIre
×1
Soldering Starter Kit
×1
LiFePO4wered/Pi+ (Optional)
×1

Software apps and online services

Discord

Hand tools and fabrication machines

As an Amazon Associate I earn from qualifying purchases you make using my affiliate links.

Story

Read more

Code

MaskMentionsCodeClean.py

Python
import discord
import json
import time

import requests

import board
import neopixel

pixels = neopixel.NeoPixel(board.D18, 12) # Raspberry Pi wiring!

def brightnessBeat():

    steps = 72
    start = time.time()
    startBrightness = 0.01
    brightnessSteps = 0.014

    for i in range(1,steps):

        startBrightness = startBrightness + brightnessSteps
        pixels.brightness = startBrightness
        pixels.fill((255, 0, 0))

        time.sleep(0.04)

    print(startBrightness)
    time.sleep(0.1)

    for i in range(1,steps):

        startBrightness = startBrightness - brightnessSteps
        pixels.brightness = startBrightness
        pixels.fill((255, 0, 0))

        time.sleep(0.04)

    time.sleep(0.1)
    end = time.time()
    pixels.fill((0, 0, 0))
    pixels.show()
    print(end-start)

class MyClient(discord.Client):

    async def on_ready(self):

        print('Logged on as', self.user)

    async def on_message(self, message):

        if "<@!YOURIDHERE>" in message.content:
            brightnessBeat()

client = MyClient()
client.run('YOUR TOKEN HERE')

Credits

Comments