Skip to content

Instantly share code, notes, and snippets.

@fbmnds
fbmnds / dht11.c
Created January 11, 2026 20:28 — forked from merlinblack/dht11.c
/**
Written 2021 by Nigel Atkinson because the predominantly found C example for
reading a DHT11 just did not work.
Greatly inspired by the Adafruit python library for DHT11 & DHT22, however
simplified and using the library wiringPi.
Adafruit write good code! :-)
Tested on a Raspberry Pi 2B r1.1
@fbmnds
fbmnds / stm32f4xx.h
Created May 20, 2025 05:39
stm32f4xx.h
/**
******************************************************************************
* @file stm32f4xx.h
* @author MCD Application Team
* @brief CMSIS STM32F4xx Device Peripheral Access Layer Header File.
*
* The file is the unique include file that the application programmer
* is using in the C source code, usually in main.c. This file contains:
* - Configuration section that allows to select:
* - The STM32F4xx device used in the target application
@fbmnds
fbmnds / emacs.txt
Created September 27, 2020 09:21
Emacs 27.1
./configure --prefix=/home/pi/.local --with-sound=yes --with-x-toolkit=yes --with-wide-int --with-cairo --with-modules --with-mailutils --with-x
sudo apt-get update
sudo apt install \
libx11-dev \
libtiff-dev \
libgtk2.0-dev \
libncurses-dev \
mailutils-imap4d \
@fbmnds
fbmnds / esp8266-toolchain.nix
Created August 18, 2019 20:21
ESP8266_RTOS_SDK
{ stdenv, fetchurl, makeWrapper, buildFHSUserEnv }:
let
fhsEnv = buildFHSUserEnv {
name = "esp8266-toolchain-env";
targetPkgs = pkgs: with pkgs; [ zlib ];
runScript = "";
};
in
@fbmnds
fbmnds / default-esp8266.nix
Created August 18, 2019 20:19
ESP8266_RTOS_SDK
{ nixpkgs ? import <nixpkgs> {} }:
let
inherit (nixpkgs) pkgs;
in
pkgs.stdenv.mkDerivation {
name = "esp8266-env";
buildInputs = with pkgs; [
gawk gperf gettext automake bison flex texinfo help2man libtool autoconf ncurses5 cmake
@fbmnds
fbmnds / esp32-toolchain.nix
Last active September 7, 2019 13:24
ESP-IDF
{ stdenv, fetchurl, makeWrapper, buildFHSUserEnv }:
let
fhsEnv = buildFHSUserEnv {
name = "esp32-toolchain-env";
targetPkgs = pkgs: with pkgs; [ zlib ];
runScript = "";
};
in
@fbmnds
fbmnds / default.nix
Last active September 7, 2019 13:23
ESP-IDF
{ nixpkgs ? import <nixpkgs> {} }:
let
inherit (nixpkgs) pkgs;
in
pkgs.stdenv.mkDerivation {
name = "esp-idf-env";
buildInputs = with pkgs; [
cmake gawk gperf gettext automake bison flex texinfo help2man libtool autoconf ncurses5 cmake
module Git =
open System
open System.Diagnostics
let private runCommand cmd args =
let startInfo = new ProcessStartInfo()
startInfo.FileName <- cmd
startInfo.Arguments <- args
startInfo.UseShellExecute <- false
startInfo.RedirectStandardOutput <- true
@fbmnds
fbmnds / StateMachine.fsx
Created May 15, 2016 19:09 — forked from taimila/StateMachine.fsx
Dynamic recursive API in F#
[<AutoOpen>]
module StateMachine =
type State =
| StateA
| StateB
| StateC
| StateD
| End
@fbmnds
fbmnds / generate.fsx
Created March 13, 2016 09:01 — forked from adamchester/generate.fsx
Generate a Visual Studio DGML Graph from F#
[<AutoOpen>]
module Workflow =
type State = Initial | Draft | PendingApproval | Approved | Cancelled | Completed
type Action = Create | Cancel | SendForApproval | Approve | Reject | Complete
type Role = Creator | Approver | Completor
type Transition = { Action:Action; From:State; To:State; Roles:Role list }
module Transitions =
let create = { Action=Create; From=Initial; To=Draft; Roles=[ Creator ] }
let cancel = { Action=Cancel; From=Draft; To=Cancelled; Roles=[ Creator ] }
let sendForAppr = { Action=SendForApproval; From=Draft; To=PendingApproval; Roles=[ Creator ] }