This file contains 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
// ------------------------------------------------------------------- | |
#define PROFILER_ENABLED 1 // ENABLED = MINOR OVERHEAD! | |
/* _______ _______ _______ | |
| | | | | | | |
| _____| | _ | | ___| | |
| |_____ | |_| | | |___ | |
|_____ | | ___| | ___| | |
_____| | | | | | |
This file contains 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
/* | |
This is designed to run on stock Sensory Bridge hardware, and uses the Sweet Spot LEDs to receive data | |
from the tool at https://sensorybridge.rocks/light_transfer/ when you hold your phone upside down 2-3 | |
inches above the LEDs! Binary data is sent through screen flashes and decoded by this Arduino Sketch, | |
printing the result to the Serial Monitor. It uses a CRC8 byte at the end of every packet to determine | |
the validity of the data sent, but no forward error correction like Hamming/Reed-Solomon codes yet. | |
Unfortunately, I can't guarantee this works on anything but a stock Sensory Bridge with OEM LEDs, so | |
this will never be the only option available for sending data to the device, but one of many. | |
This file contains 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
# ---------------------------------------------------------------------------- | |
# LOVELY MUSIC GENERATOR by LIXIE LABS | |
# https://leds.social/@lixielabs | |
# | |
# Plays random notes/chords from the Amaj7 scale in a pleasing fashion using | |
# audiopwmio to drive a speaker with five synthio sine voices and ADSR envelopes. | |
# Import dependencies | |
import time | |
import board |
This file contains 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
// This function reduces harsh blue tones in RGB LED lights, bringing | |
// them closer to the look of retro tinted incandescent bulbs. | |
// | |
// All input colors to the christmas_light_fixer() function are multiplied | |
// by a LUT of a warm white, reducing the power of the blue spectrum while | |
// preserving the brightness of the yellow spectrum. | |
CRGB christmas_light_fixer( CRGB input_color ){ | |
CRGB incandescent_lookup = CRGB( 255, 113, 40 ); | |
CRGB out_color = input_color; |
This file contains 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
// Draws an open-ended polygon using anti-aliased strokes with user-defined subpixel positioning, scaling and opacity. | |
// The coordinates of the vertices of your polygon are floating point values on or between LED coordinates, not 0.0-1.0 | |
// like UV coordinates. Output is grayscale values (0.0-1.0) written to a global "float mask[Y_SIZE][X_SIZE]" array. | |
// Polygons are defined as a 2D array of vertices that form a vector shape, no closed shapes officially supported yet. | |
// On an ESP32-S3, this rasterizes the polygon very, VERY quickly. | |
void lixie_aa_polygon(float vertices[][2], uint16_t num_vertices, float x_offset, float y_offset, float x_scale, float y_scale, float angle_deg, float opacity) { | |
// Line thickness | |
float stroke_width = 1.0; // Alter this | |
float stroke_width_inv = 1.0 / stroke_width; // Don't alter this |
This file contains 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
#include <TimeLib.h> | |
#include <WiFiUdp.h> | |
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager | |
#include "Pixie_Chroma.h" // ... Include library | |
PixieChroma pix; // ............ Get class object | |
WiFiUDP Udp; | |
#define DATA_PIN 5 // GPIO to use for Pixie Chroma data line | |
#define PIXIES_X 3 // Total amount and arrangement |
This file contains 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
// Allows for a "print()" function that accepts char* to take any common variable type | |
// Also allows you to detect the type of any variable if that type was first defined | |
// in a MAKE_TYPE_INFO(type) macro | |
// @lixielabs 4/27/22 | |
template <typename t_type> struct type_info { static const char * name; }; // Define type_info | |
template <typename t_type> const char * type_info<t_type>::name = "unknown"; // Set default state | |
#define TYPE_NAME(var) type_info< typeof(var) >::name // Macro to parse variable type name | |
#define MAKE_TYPE_INFO(type) template <> const char * type_info<type>::name = #type; // Macro to define variable type name |
This file contains 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
#include "Pixie_Chroma.h" // ... Include library (1.0.0 used here) | |
PixieChroma pix; // ............ Get class object | |
#define PIXIES_PER_PIN 3 // ... Needed for quad mode | |
#define PIXIES_X 6 // ... How many Pixie PCBs "wide" is our display? | |
#define PIXIES_Y 2 // ... How many tall? | |
void setup() { | |
pix.begin_quad(PIXIES_PER_PIN, PIXIES_X, PIXIES_Y); // Initialize Pixies |
This file contains 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
# Pixie driver test abusing SPI bus for clean data transfer at any speed | |
# If this works, let me know so I can simplify usage! | |
# Currently it sends a raw byte array below to render images to connected | |
# Pixies, flashing between a PIX_SMILE icon and a solid color at a visible rate. | |
# ------------------------------------------------------------------------- | |
# SPI must be enabled using "sudo raspi-config" under "Interfacing Options" | |
# ------------------------------------------------------------------------- | |
import spidev |
This file contains 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
volatile bool broadcast_done = false; | |
volatile uint8_t bit_index = 0; | |
volatile uint16_t byte_index = 0; | |
volatile uint8_t sync_count = 0; | |
uint8_t pixel_bit = 0; | |
uint8_t pixel_byte = 0; | |
bool bit_changed = false; | |
const uint8_t image[4800] PROGMEM = { | |
0, 15, 143, 255, 255, 255, 255, 255, 255, 255, 0, 31, 254, 0, 63, 252, 7, 128, 0, 0, 0, 0, 0, 15, 143, 255, 255, 255, 255, 255, 255, 255, 0, 31, 254, 0, 63, 252, 7, 128, 0, 30, 7, 128, 15, 255, 0, 31, 255, 255, 128, 15, 255, 0, 31, 254, 14, 0, 0, 0, 0, 0, 0, 31, 7, 128, 15, 255, 0, 31, 255, 255, 128, 15, 255, 0, 15, 254, 15, 0, 0, 124, 3, 192, 7, 255, 128, 15, 255, 255, 192, 3, 255, 128, 7, 255, 60, 0, 0, 0, 0, 0, 0, 60, 3, 192, 7, 255, 128, 15, 255, 255, 224, 3, 255, 128, 7, 255, 28, 0, 0, 248, 1, 224, 3, 255, 192, 7, 255, 255, 240, 1, 255, 192, 3, 255, 248, 0, 0, 0, 0, 0, 0, 248, 1, 224, 1, 255, 192, 3, 255, 255, 240, 1, 255, 224, 3, 255, 248, 0, 255, 240, 1, 240, 1, 255, 224, 3, 255, 255, 248, 0, 255, 240, 1, 255, 240, 0, 255, 255, 255, 255, 255, 240, 0, 240, |
NewerOlder