Skip to content

Instantly share code, notes, and snippets.

@embedded-creations
embedded-creations / ColorTwinkles.ino
Last active January 29, 2021 17:43 — forked from kriegsman/ColorTwinkles.ino
Twinkling 'holiday' lights that fade in and out.
#include "FastLED.h"
#define LED_PIN 3
#define LED_TYPE WS2811
#define COLOR_ORDER RGB
#define NUM_LEDS 50
CRGB leds[NUM_LEDS];
// Twinkling 'holiday' lights that fade up and down in brightness.
// Colors are chosen from a palette; a few palettes are provided.
@embedded-creations
embedded-creations / gamma.c
Last active May 8, 2020 14:14
Gamma Table Calculator adapted from adafruit/RGB-matrix-Panel
// THIS IS NOT ARDUINO CODE -- DON'T INCLUDE IN YOUR SKETCH. It's a
// command-line tool that outputs a gamma correction table to stdout;
// redirect or copy and paste the results into header file for the
// RGBmatrixPanel library code.
//
// Optional 2 parameters:
// - bit depth (default=4, for 16 output levels).
// - tableSize (default=256 for gamma_table[256])
//
// typical usage:
@embedded-creations
embedded-creations / index.html
Created September 3, 2018 09:32
jsPDF image from file
<script type="text/javascript" src="//cdn.rawgit.com/MrRio/jsPDF/master/dist/jspdf.min.js"></script> <script type="text/javascript" src="//cdn.rawgit.com/MrRio/jsPDF/master/plugins/addimage.js"></script> <script type="text/javascript" src="//cdn.rawgit.com/MrRio/jsPDF/master/plugins/png_support.js"></script> <script src="http://cdn.rawgit.com/MrRio/jsPDF/master/libs/png_support/png.js"></script> <script src="http://cdn.rawgit.com/MrRio/jsPDF/master/libs/png_support/zlib.js"></script>
<input id="inp" type='file'>
<p id="b64"></p>
<img id="img" height="150">
<button id="btnDownload">Download PDF</button>
@embedded-creations
embedded-creations / mcpwm_basic_config_example.c
Last active February 27, 2018 15:43
ESP32 - Trying to connect GPIO output to peripheral input though GPIO Matrix with single pin
/* MCPWM basic config example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
/*
@embedded-creations
embedded-creations / networktest.ino
Last active June 30, 2016 15:11
Test to see how long it can take for the functions in system_sleep() to run - for Electron with Particle Build
STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));
const int delayAfterPublishMilliseconds = 5000;
const uint32_t magicWordComparison = 0xDEADBEEF;
retained uint32_t maxNetworkSuspendTimeSeconds = 0;
retained uint32_t maxNetworkDisconnectTime = 0;
retained uint32_t maxNetworkOffTime = 0;
retained uint32_t maxNetworkFunctionTime = 0;
@embedded-creations
embedded-creations / SleepTest.cpp
Last active June 22, 2016 19:00
Demonstrate bug in System.sleep() - will sleep infinitely long with small values of `seconds`
#include "application.h"
STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));
// if you want to change sleepTimeSeconds or reset sleepTimeSeconds back to maxSleepTimeSeconds, change the value of magicWordComparison and reflash application
const uint32_t magicWordComparison = 0xDEADBEEF;
const unsigned int maxSleepTimeSeconds = 10;
retained unsigned int sleepTimeSeconds = maxSleepTimeSeconds;
retained uint32_t magicWord = magicWordComparison;
@embedded-creations
embedded-creations / cell-locate.cpp
Created June 20, 2016 20:52 — forked from technobly/cell-locate.cpp
Cellular Locate Test Application
/******************************************************************************
Copyright (c) 2015 Particle Industries, Inc. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, either
version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@embedded-creations
embedded-creations / WakeupLight.ino
Last active April 14, 2016 16:04
Wakeup Light Project - Minimal Version
/*
* Wakeup Light - Minimal Version
*
* Copyright (c) 2016 Louis Beaudoin (Pixelmatix)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
@embedded-creations
embedded-creations / WakeupLight.ino
Last active April 14, 2016 16:03
Wakeup Light - Test receiving message using "wakeup" function
/*
* Wakeup Light - Test "wakeup" Function Only
*/
#include "InternetButton.h"
InternetButton b = InternetButton();
int wakeupHandler(String command) {
Serial.println();
@embedded-creations
embedded-creations / PhotonTimingTest.ino
Last active March 31, 2016 10:52 — forked from kasperkamperman/PhotonTimingTest.ino
Test FastLED.show timing on different Particle Photon pins.
/*
Measurement of the FastLED.show() routine.
Soft SPI is only supported till now on the Photon.
However non-SPI pins seem to be 140us faster then when using the SPI pins.
Using those SPI pins in hardware design might be interesting for future compatibility
when hardware SPI gets supported.
Below the timing test of different pin combinations. The APA102 is updated at 16Mhz.
*/