Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gamblor21/laughing_skull
When the light shines on this project an animated laughing skull appears along with audio of of evil laughing. Written in CircuitPython and tested on several Adafruit boards.
https://github.com/gamblor21/laughing_skull
circuitpython halloween prank
Last synced: about 2 months ago
JSON representation
When the light shines on this project an animated laughing skull appears along with audio of of evil laughing. Written in CircuitPython and tested on several Adafruit boards.
- Host: GitHub
- URL: https://github.com/gamblor21/laughing_skull
- Owner: gamblor21
- License: mit
- Created: 2020-10-03T16:10:51.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-27T02:36:37.000Z (about 3 years ago)
- Last Synced: 2024-10-03T19:43:16.650Z (3 months ago)
- Topics: circuitpython, halloween, prank
- Language: Python
- Homepage:
- Size: 6.22 MB
- Stars: 7
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Light Triggered Laughing Skull
![Laughing Skull](/hallowing.png)Create a fun prank for Halloween or any time of the year. Hide the project somewhere dark and wait. When someone opens a door or shines a light on the project, it wakes up displaying an animated laughing skull and playing evil laughter. This continues until it gets dark again (or they find and unplug the battery!)
## Installation
This project required CircuitPython 6.x. The beta version of this release can be found from the [CircuitPython](https://circuitpython.org/) website. Instructions for installing new releases of CircuitPython can be found there.Copy the appropriate *code-xxxxxx.py* onto your CircuitPython device and rename it to **code.py**.
Copy the *skull_* bmp files and the *laugh.mp3* file to your device.
Depending on your device you may require libraries to be installed in your lib directory.
* adafruit_imageload (All)
* adafruit_apds9960 (Clue)
* adafruit_gizmo (Circuit Playground Bluefruit)
* adafruit_st7789 (For ST7789 breakout TFT)****NEW**** Use a distance sensor to detect someone close and start laughing. The code-distance.py file is set to trigger from a UC-100 based sensors available here https://www.adafruit.com/product/4019. Print out the 3d tombstone and embed everything in a single item.
## Recommended Hardware
This project is written in CircuitPython and has been tested on several Adafruit boards and is easily adaptable to run on other hardware. It runs best on a M4 processor but can run acceptably on an nRF52840. The code has switches to turn off audio or animation, and to change the animation speed slower. All of which may help on a slower processor. The images are scaled for a 240x240 display but could be resized. The audio is mono and should play through any mono speaker.
Of the boards I have tested it on the project works best on the Hallowing M4. This amazing board has everything you need already built into it. The screen, light sensor and audio are all already there so nothing besides a small speaker is required.
A small battery is perfect to place this project somewhere dark and wait for an unsuspecting person to open the door.
## Tested Adafruit Hardware:
* [Hallowing M4](https://www.adafruit.com/product/4300)
* [Circuit Playground Bluefruit](https://www.adafruit.com/product/4333) with [TFT Gizmo](https://www.adafruit.com/product/4367)
* [Clue](https://www.adafruit.com/product/4500) with [PAM8302 Amplifier](https://www.adafruit.com/product/2130)
* [ItsyBitsy M4](https://www.adafruit.com/product/3800) with [PAM8320 Amplifier](https://www.adafruit.com/product/2130), [ST7789 240x240 display](https://www.adafruit.com/product/3787) and [ALS-PT19 Light Sensor](https://www.adafruit.com/product/2748)All the projects had a small 4-8ohm speaker attached for audio out.
### The project requires the following components:
* Processor board to run the project (M4 recommended)
* 240x240 Display
* Audio out
* Light sensor
* Distance sensor (optional)It is fairly easy to swap out components if you have another you would like to use. All initializations are at the top of the code.
## Configuration
The configuration is all near the top of the python file. These are the most likely values you will want to change.```python
USE_LIGHT_SENSOR = False # if you want to disable the light sensor
USE_DISTANCE_SENSOR = True # if you want to disable the distance sesnor
USE_NEOPIXELS = True # if you want to use the onboard neopixelsLIGHT_VALUE = 1500 # value at which we turn on / off the laughing
DISTANCE_VALUE = 50 # value at which we turn on / off the laughing
MODE_SWITCH_TIME = 0.2 # how long to wait for a changed reading
# to be consistent to change modes
LAUGHING_SPEED = 0.1 # how fast the animation runsUSE_AUDIO = True # if you want to disable audio
USE_ANIMATION = True # if you want to disable animation
```## Ideas
This project could be expanded upon to change how it reacts in even more ways.
* Boards like the Hallowing have a built in motion sensor that could be used (if you shake it maybe it says to put it down!)
* A microphone sensor could allow the project to react to sound instead of light
* New sounds and animations can be added following the base code that is provided### Credits for Audio
The audio was a mix of several tracks from:
* [The Baron - Evil Laugh](https://freesound.org/people/The%20Baron/sounds/98382/)
* [TChild - Evil Laugh](https://freesound.org/people/tchild/sounds/319766/)
* [Craigh Smith - Women Screaming](https://freesound.org/people/craigsmith/sounds/438420/)