This file contains hidden or 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
import time,sys | |
from machine import Pin | |
from neopixel import NeoPixel | |
color = [0,64,64] | |
if len(sys.argv) >= 4: | |
try: | |
col = [int(sys.argv[1]),int(sys.argv[2]),int(sys.argv[3])] | |
color = col | |
except: |
This file contains hidden or 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 <Adafruit_CircuitPlayground.h> | |
#include <Wire.h> | |
#include <SPI.h> | |
#define BLINKY 13 | |
// Threshold for a capacitive touch (higher = less sensitive). | |
#define CAP_THRESHOLD 100 | |
// Number of samples to take for a capacitive touch read. | |
#define CAP_SAMPLES 40 |
This file contains hidden or 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
// a variation of https://gist.github.com/Neradoc/86b3468a1612f8e1d57db20ab2fab5ae | |
// uses an empty enum as namespace for static functions | |
// otherwise it's pretty much the same | |
enum Log { | |
private static func __log<T>(type:String,_ input:T) { | |
//#if DEBUG | |
print(type,input) | |
//#endif |
This file contains hidden or 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
// A logging function that uses emojis to make the output prettier | |
// - one clear way to specify the type of display we want | |
// - provide type safety for the printed parameter | |
// - no weird operator syntax ;-) | |
// Inspired by "Swift: Pretty in print()" by Andyy Hope | |
// part 1: https://medium.com/p/64832bb7fafa/ | |
// part 2: https://medium.com/p/640cea920653/ | |
// Note: Ideally you would give the object to print first, so the completion |
NewerOlder