Instantly share code, notes, and snippets.

View ws281x_dma_timer.ino
/*
ws2812x_dma_timer.ino - DMA/TIMER based ws281x/neopixel routines
Generate a ws281x compatible pulse train using PWM timer and DMA
provided duty cycle data. Connect pin PA1 to the DIN of a ws281x
led strip and watch the animation.
2018-07-07 - RRK simplified using RGB values, compute T0/T1 based on F_CPU
2018-07-05 - RRK reworked to avoid interrupt
*/
View blink.cpp
View print_t.h
/*
* zero_print - print_base<> template example
*/
#include "print_t.h"
void setup() {
Serial.begin(115200);
delay(2000);
}
View Makefile
#
# Makefile - blinkasm.elf
#
# Author: Rick Kimball
# email: rick@kimballsoftware.com
# Version: 1.04 Initial version 10/21/2011
#
APP = blinkasm
MCU ?= msp430g2553
View nco.vhd
-------------------------------------------------------------------------
-- nco.vhd - Numerically Controlled Oscillator
--
-- Author: Rick Kimball rick@kimballsoftware.com
-- Date: 10/19/2017
-- Version: 3
--
-- vim: set ts=3 sw=3 expandtab
--
View nco.cpp
/*
* nco.cpp - toggle pins at 60Hz and 50Hz using a 50kHz timer clock
*/
#include <fabooh.h>
#include <main.h>
#include <nco.h>
RED_LED RED;
GREEN_LED GREEN;
View nco.cpp
// vim: set ts=2 sw=2 expandtab list
/*
* File: nco.cpp
* Description: NCO c++ template and testdriver
*
* Author: rick kimball
*
* g++ -DDEBUG -Wall -Os -g nco.cpp -o nco
*/
View print_64t.ino
// sketch_oct16a
// printll provides printing for int64_t uint64_t types using Streaming..
// Rick Kimball
#include "Streaming.h"
char * _print_base(char *buf, uint64_t n, int base) {
char *str = &buf[(64+1) - 1]; // handle printing bits
*str = '\0'; // work from least significant digit to most
View Makefile
# STM32F1/Makefile - provide a way to use a custom boards.txt
#
#
.phony: all checkout clean
all: boards.txt
checkout:
git checkout boards.txt
boards.txt:
View w1_poll.sh
#!/bin/bash
# read the w1-temp values
# put each line1 and 2 into variables
# parse and see if it is ready
# if so read the raw value and round it to 2 decimals
read_sensor()
{
SENSOR_FILE=$1
local __celsius_raw=$2