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 AUTO_OFF 1 /* minutes */ | |
unsigned int lastOn = 0; | |
void setup() { | |
Spark.function("shoutRainbows", nyanHandler); | |
} | |
void loop() { | |
//nothing to see here! | |
if (lastOn > 0) { |
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
int laser = 0; | |
unsigned int lastPublish = 0; | |
bool lastState = false; | |
void setup() { | |
pinMode(A0, INPUT_PULLDOWN); | |
pinMode(D7, OUTPUT); | |
} | |
void loop() { |
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
SYSTEM_MODE(MANUAL); | |
void setup() { | |
Serial.begin(9600); | |
Serial1.begin(9600); | |
pinMode(D7, OUTPUT); | |
} | |
void loop() { | |
if (Serial1.available()) { |
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 publish_delay 10000 | |
#define PUBLISH_TO "some_private_event_1" | |
#define PUBLIC_EVENT "some_public_event_1" | |
unsigned int lastPublish = 0; | |
void setup() { | |
Serial.begin(115200); | |
//the firmware uses the event name to figure out which handler it should toss things to, and doesn't select based on privacy, so we need to also make the event names differ in this example. |
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
/*------------------------------------------------------------------------- | |
Spark Core library to control WS2811/WS2812 based RGB | |
LED devices such as Adafruit NeoPixel strips. | |
Currently handles 800 KHz and 400kHz bitstream on Spark Core, | |
WS2812, WS2812B and WS2811. | |
Also supports: | |
- Radio Shack Tri-Color Strip with TM1803 controller 400kHz bitstream. | |
- TM1829 pixels |
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 "application.h" | |
#include "ctrl.h" | |
Ctrl::Ctrl() | |
{ | |
init(); | |
} | |
Ctrl::~Ctrl(){ | |
} |
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 DEFAULT_BRIGHTNESS 1 | |
#define NUM_PIXELS 8 | |
float pixels[NUM_PIXELS]; | |
#define KERNEL_SIZE 5 | |
float kernel[KERNEL_SIZE] = { 1, 0.8, 0.4, 0.8, 1 }; | |
int kernelPos = -1 * KERNEL_SIZE; |
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 #include statement was automatically added by the Particle IDE. | |
#include "neopixel/neopixel.h" | |
#include "math.h" | |
SYSTEM_MODE(MANUAL); | |
#define RANDOM_SPIRITS true | |
#define RANDOM_SPIRIT_CHANCE 0.10 |