Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathanaël Lécaudé natcl

View GitHub Profile
View ledPot.ino
#include <Adafruit_NeoPixel.h>
#include <Bounce2.h>
#define LED_PIN 17
#define BUTTON_PIN 3
#define POT_PIN 14
#define NUM_LEDS 83
#define BRIGHTNESS 100
@natcl
natcl / docker-compose.yaml
Last active Apr 26, 2021
traefik: node-red + mosquitto using letsencrypt
View docker-compose.yaml
version: "3.3"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--api=true"
- "--api.dashboard=true"
@natcl
natcl / diamonds.p8
Created Feb 17, 2020
Diamonds in Pico-8
View diamonds.p8
pico-8 cartridge // http://www.pico-8.com
version 18
__lua__
border_size=4
brick_width=10
brick_height=7
function _init()
cls()
//for r=0,11 do
View ble+nfc.js
var buttonState = false;
var flashing = false;
setWatch(function () {
if (flashing) return;
var batteryPercentage = Puck.getBatteryPercentage();
buttonState = buttonState ? false : true;
if (buttonState) {
flashLed(LED2, 200, 1);
NRF.nfcURL("http://cosmiquecarrousel.com");
View diamonds.p8
pico-8 cartridge // http://www.pico-8.com
version 18
__lua__
border_size=4
brick_width=10
brick_height=7
function _init()
cls()
//for r=0,11 do
@natcl
natcl / nfc.js
Last active Sep 10, 2019
Puck.js NFC
View nfc.js
var buttonState = false;
var flashing = false;
setWatch(function () {
if (flashing) return;
var batteryPercentage = Puck.getBatteryPercentage();
buttonState = buttonState ? false : true;
if (buttonState) {
flashLed(LED2, 200, 1);
NRF.nfcURL("http://cosmiquecarrousel.com");
View gist:38e3cfc2d523afa7510ec97a3af9e667
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(12, GPIO.OUT)
p = GPIO.PWM(12, 100)
p.start(5)
time.sleep(2)
for angle in range (25, 180):
View pronto.js
function pronto(d) {
var a=d.trim().split(" ").map(x=>parseInt(x,16));
var freq = 4145146/a[1];
Puck.IR(a.slice(4).map(x=>1000*x/freq));
}
var power = "0000 006C 0000 0022 00AD 00AD 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 06FB";
setWatch(
function() {
console.log("HH");
@natcl
natcl / docker-compose.yaml
Created Sep 26, 2018
docker-compose static IP example
View docker-compose.yaml
version: '3'
networks:
mynetwork:
ipam:
config:
- subnet: 172.20.0.0/24
services:
nodered1:
image: nodered/node-red-docker
ports:
@natcl
natcl / Dockerfile
Last active Jan 30, 2021
Node-RED Docker ENV test
View Dockerfile
FROM ubuntu:16.04
RUN \
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
apt-get update && \
apt-get -y upgrade && \
apt-get install -y build-essential curl && \
apt-get install -y software-properties-common && \
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
apt-get install -y nodejs