Skip to content

Instantly share code, notes, and snippets.

View bboyho's full-sized avatar

Ho Yun "Bobby" bboyho

View GitHub Profile
@bboyho
bboyho / testshapes_32x64SparkFunQA.ino
Created May 11, 2018 02:10
testshapes_32x64SparkFunQA
// testshapes demo for RGBmatrixPanel library.
// Demonstrates the drawing abilities of the RGBmatrixPanel library.
// For 32x64 RGB LED matrix.
// NOTE THIS CAN ONLY BE USED ON A MEGA! NOT ENOUGH RAM ON UNO!
#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
#define CLK 11
@bboyho
bboyho / testshapes_32x64SparkFun.ino
Last active June 27, 2019 17:57
SparkFun Product Showcase Demo for 32x64 RGB LED Panel => https://youtu.be/uWds5Q4xcN0
// modified: May 10, 2018
//
// testshapes demo for RGBmatrixPanel library.
// Demonstrates the drawing abilities of the RGBmatrixPanel library.
// For 32x64 RGB LED matrix.
// NOTE THIS CAN ONLY BE USED ON A MEGA! NOT ENOUGH RAM ON UNO!
#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
@bboyho
bboyho / BlinkAPA102_mod_Glove_Button.ino
Last active September 17, 2018 20:42
Code to control APA102s with a button press.
#include "FastLED.h"
// How many leds in your strip?
#define NUM_LEDS 8
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 3
#define CLOCK_PIN 13
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 6
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
/* Arduino.cc RGB Crossfade
* https://www.arduino.cc/en/Tutorial/ColorCrossfader
* Modified by Bobby with Custom Color Mixing
* https://learn.sparkfun.com/tutorials/lilypad-protosnap-plus-activity-guide/3-custom-color-mixing
Code for cross-fading 3 LEDs, red, green and blue (RGB)
To create fades, you need to do two things:
1. Describe the colors you want to be displayed
2. List the order you want them to fade in
//from
//https://bikeshedeffect.weebly.com/arduino-piezo-sounds.html
/* insert sound code into setup to play once, main loop to repeat, or into sound() function to call when wanted (button push, etc...)// Speaker must be on pin 8, see setup here: http://www.arduino.cc/en/Tutorial/PlayMelody
*/
#include "pitches.h" // must include open source pitches.h found online in libraries folder or make a new tab => https://docs.arduino.cc/built-in-examples/digital/toneMelody
void setup() {
// do nothing
#include "pitches.h" // must include open source pitches.h found online in libraries folder or make a new tab => https://www.arduino.cc/en/Tutorial/toneMelody
int button1State = LOW;
void setup() {
pinMode(4, INPUT_PULLUP);
pinMode(5, OUTPUT);
}
/* Arduino.cc RGB Crossfade
https://www.arduino.cc/en/Tutorial/ColorCrossfader
Modified by Bobby with Custom Color Mixing
https://learn.sparkfun.com/tutorials/lilypad-protosnap-plus-activity-guide/3-custom-color-mixing
https://learn.sparkfun.com/tutorials/picobuck-hookup-guide-v12
Code for cross-fading 4 LEDs, red, green, blue, and white (RGBW)
To create fades, you need to do two things:
1. Describe the colors you want to be displayed
2. List the order you want them to fade in
/* Modified FastLED example to stress test power supplies
* by using long lengths of LED strips and setting brightness
* to max. This was used in the Mean Well LED Switching Power
* Supply Hookup Guide on WS2812-based LEDs.
*
* https://learn.sparkfun.com/tutorials/mean-well-led-switching-power-supply-hookup-guide/
*
* However, it can be be used on other addressable
* LED chipsets by adjusting the LED_type.
*/