Skip to content

Instantly share code, notes, and snippets.

@cpldcpu
cpldcpu / LowPowerLEDflasher.c
Created February 7, 2021 02:10
Low Power LED Flasher on PFS154
/* ---------------------------------------------------
Ultra Low Power LED flasher
LED is connected to PA4 and is high active.
Jan 16th, 2021, CPLDCPU - Initial version
---------------------------------------------------- */
#include <stdint.h>
@cpldcpu
cpldcpu / lightsensor.c
Created September 29, 2019 09:46
Light sensor on PFS154
/* ---------------------------------------------------------------
ligthsensor.c
LED is connected to PA0 (anode) and PA4 (cathode).
Sep 21, 2019 cpldcpu - first release
Sep 29, 2019 cpldcpu - last iteration after many tries. It appears the PFS154
is too noisy for this to work.
------------------------------------------------------------------ */
@cpldcpu
cpldcpu / candleasm.s
Created September 23, 2019 19:29
Electronic candle based on Padauk PMS150C
;--------------------------------------------------------
; Electronic candle for Padauk PMS150C and SDASPDK (SDCC toolchain)
; LED is connected to PA4, Timer2 is used to drive LED
; Implements algorithm from:
; https://github.com/cpldcpu/CandleLEDhack/blob/master/Emulator/CandeflickerLED.c
;
; cpldcpu Jan 2019
;--------------------------------------------------------
.module blinky
.optsdcc -mpdk14
@cpldcpu
cpldcpu / gist:8387639
Created January 12, 2014 17:20
WS2812_SCAN - Exercise a WS2812 LED with different timing parameters. For each set of timing parameters (j,k) the following is performed: - Wait 10µs to reset the WS2812 LED - Emit 48 pulses with the given timing Compiles with AVR-GCC for ATtiny85. LED is connected on PB1.
/*
* WS2812_SCAN.c
*
* Created: 10.01.2014 20:46:20
* Author: tim
*/
#include <avr/io.h>
int main(void)