Skip to content

Instantly share code, notes, and snippets.

View Miceuz's full-sized avatar

Albertas Mickėnas Miceuz

View GitHub Profile
@Miceuz
Miceuz / vu-meter.ino
Last active November 15, 2015 15:38
VU meter based on TLC5940 led dimmer
#include "Tlc5940.h"
void setup() {
Tlc.init();
}
uint32_t level = 0;
void loop() {
/*
Fades a line down the channels, with max value and duration based on
the voltage of analog pin 0.
Try grounding analog 0: everything should turn off.
Try putting +5V into analog 0: everything should turn on.
See the BasicUse example for hardware setup.
Alex Leone <acleone ~AT~ gmail.com>, 2009-02-03 */
#define STEP_X 49
#define DIR_X 51
#define ENA_X 53
#define STEP_Y 43
#define DIR_Y 45
#define ENA_Y 47
void setup() {
pinMode(STEP_X, OUTPUT);
@Miceuz
Miceuz / avrdude.conf
Last active January 4, 2018 16:00
avrdude.conf patch for AtTiny441
#------------------------------------------------------------
# ATTiny441
#------------------------------------------------------------
part
id = "t441";
desc = "ATtiny441";
has_debugwire = yes;
flash_instr = 0xB4, 0x07, 0x17;
@Miceuz
Miceuz / cie1931.py
Created April 19, 2016 15:05
cie color correction table
INPUT_SIZE = 255 # Input integer size
OUTPUT_SIZE = 255 # Output integer size
INT_TYPE = 'const unsigned char'
TABLE_NAME = 'cie';
def cie1931(L):
L = L*100.0
if L <= 8:
return (L/902.3)
else:
//the original code by Ted Meyers
//posted here: https://groups.google.com/d/msg/diyrovers/lc7NUZYuJOg/ICPrYNJGBgAJ
#include <Wire.h>
#define VL53L0X_REG_IDENTIFICATION_MODEL_ID 0xc0
#define VL53L0X_REG_IDENTIFICATION_REVISION_ID 0xc2
#define VL53L0X_REG_PRE_RANGE_CONFIG_VCSEL_PERIOD 0x50
#define VL53L0X_REG_FINAL_RANGE_CONFIG_VCSEL_PERIOD 0x70
#define VL53L0X_REG_SYSRANGE_START 0x00
#include <ESP8266WiFi.h>
#include <Base64.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Phant.h>
//AP definitions
#define AP_SSID "TECHNARIUM"
#define AP_PASSWORD "change me"
/*
* A controller for Schiederwerk PVG 12-12 AC Electronic Lamp Power Supply
* for metal halide lamps
*
* © Albertas Mickėnas 2016
* [email protected] [email protected]
* This code is Open Source distributed under Apache 2.0 licence.
*/
#include <Bounce2.h>
#include<SPI.h>
#include <Tone.h>
Tone player;
void beep(){
player.play(4000);
delay(100);
player.stop();
}
#include "Tlc5940.h"
void setup() {
Tlc.init();
}
void fadeOut() {
for(int j = 4095; j >= 0; j--){
for(int i = 0; i < 16; i++) {
Tlc.set(i, j);