Skip to content

Instantly share code, notes, and snippets.

View natcl's full-sized avatar

Nathanaël Lécaudé natcl

View GitHub Profile
@natcl
natcl / table
Created November 12, 2021 22:21
const dayToString = {
0: 'Sunday',
1: 'Monday',
2: 'Tuesday',
3: 'Wednesday',
4: 'Thursday',
5: 'Friday',
6: 'Saturday'
}
@natcl
natcl / ledPot.ino
Created February 12, 2021 01:39
ledPot
#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 February 1, 2024 15:02
traefik: node-red + mosquitto using letsencrypt
version: "3.3"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--api=true"
- "--api.dashboard=true"
@natcl
natcl / diamonds.p8
Created February 17, 2020 21:19
Diamonds in Pico-8
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
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");
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 September 10, 2019 01:40
Puck.js NFC
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");
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):
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 September 26, 2018 14:31
docker-compose static IP example
version: '3'
networks:
mynetwork:
ipam:
config:
- subnet: 172.20.0.0/24
services:
nodered1:
image: nodered/node-red-docker
ports: