Skip to content

Instantly share code, notes, and snippets.

@jschoch
jschoch / printer.cfg
Created September 22, 2018 15:08
klipper mks gen-L
# This file contains pin mappings for the 2017 Creality CR-10S with a MKS Gen-L board. To use
# this config, the firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: ar54
dir_pin: ar55
enable_pin: !ar38
step_distance: .0125
@jschoch
jschoch / foo.eex
Created February 16, 2018 17:26
drab components
// brainstorming drab components
user = get_user(..)
thing = get_thing(..)
render("page.html",user: user, thing: thing)
# in page.html
#include <Wire.h>
#include <Arduino.h>
#include <MLX90393.h>
#include <NeoPixelBus.h>
#include <NeoPixelAnimator.h>
// prints Bx By Bz (in uT) and temperature (C) to serial console after receiving a character
MLX90393 mlx;
uint8_t status;
// Distributed with a free-will license.
// Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
// MLX90393
// This code is designed to work with the MLX90393_I2CS I2C Mini Module available from ControlEverything.com.
// https://www.controleverything.com/products
#include<Wire.h>
#include "SSD1306.h"
SSD1306 display(0x3c, 5, 4);
/*
* based on STM32duino.com's HardTimerAsEncoder.ino demo and WS2812b
WS2812b data pin connects to MOSI pin on STM32 (for blue pill it is PA7 i believe)
Encoder data channels connect to CH1 and CH2 for each timer configured. board.cpp appears to have the correct mappings
*/
@jschoch
jschoch / gist:7fc79ddeace2e73c6dbf5d106a6e165c
Created October 17, 2017 21:48
crappy esp32 quadrature decoder fail
#include "SSD1306.h" // alias for `#include "SSD1306Wire.h"`
SSD1306 display(0x3c, 5, 4);
int HAL_A = 25;
int HAL_B = 26;
volatile byte prior_state[2] = {LOW,LOW};
volatile int count = 0;
volatile bool inc = false;
volatile bool hals[2];
volatile long enc_count = 0;
Detected errors in 1 module.
-- TYPE MISMATCH ---------------------------------------------------------------
The 2nd argument to function `send` is causing a mismatch.
129| Http.send Unf postBooks
^^^^^^^^^
Function `send` is expecting the 2nd argument to be:
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Html.Events exposing (onInput,onClick)
import List
import Json.Decode
main =
App.beginnerProgram
{ model = model
import Html exposing (text,div)
import Json.Encode
import Markdown
type alias R = List(String,String)
t = ("a","b")
r = [t,t]
module Const exposing (..)
-- Constants for my use
-- config constants
-- Material constants