Skip to content

Instantly share code, notes, and snippets.

@allenday
allenday / rice3k-hw-equlibrium.sql
Created March 6, 2019 10:52
Rice3K analysis 2: some specific regions are under selective pressure
#standardSQL
--
-- The following query computes the Hardy-Weinberg equilibrium for variants.
--
WITH variants AS (
SELECT reference_name, start_position, end_position, reference_bases, alt,
SUM(HOM_REF) AS HOM_REF,
SUM(HOM_ALT) AS HOM_ALT,
SUM(HET) AS HET
FROM (
@CS2098
CS2098 / line_follower.py
Last active February 29, 2024 02:58
A LEGO Mindstorms ev3 line follower program in Python
# line_follower.py
# by: Carl Strömberg
# Import the EV3-robot library
import ev3dev.ev3 as ev3
from time import sleep
class LineFollower:
# Constructor
@stonehippo
stonehippo / smartmaker_lcd_correct_pins.md
Last active December 24, 2017 23:54
Correct pins for the Smartmaker Smarthost LCD 16X2 boards

Correct Smartmaker Smarthost 16X2 Board Pin Config

The Smartmaker Smarthost LCD 16X2 boards (Smarthost LCD PRO, Smarthost LCD 16X2 MOD, and Smarthost LCD 16X2) are all carrier boards for Hitachi HD44780 driver-compatible 16x2 LCD displays.

In theory, these boards should "just work" with the Arduino LiquidCrystal library. The examples for that lib are all built around this de facto standard interface. And according to the document in the Smartmaker Wiki, the pins used in the example code (digital pins 12, 11, 5, 4, 3, and 2) are supposed to be the same ones that Smarthost LCD boards use: Smartbus pins B13, B12, B06, B05, B04, and B03, which map to the Arduino pins in question.

The correct pins

It turns out the reality of the boards doesn't match the Smartm

@stonehippo
stonehippo / smartcore_arduino_pin_mapping.md
Last active January 5, 2019 22:07
Mapping Smartmaker Smartcore CPU pins to Arduino pins.

Pin Mapping the Smartmaker Smartcores to Arduino Pins

This note details the pin mappings for the Smartmaker Smartcore microcontrollers to Arduino standards pins.

Smartmaker Smartcore: A Brief Intro

The Smartmaker1 Smartcores are small-form-factor Arduino clones.

The special thing about Smartcores is their use of the Smartmaker Open System I/O Smartbus, which is basically a snap-together bus interface for components based on pairs of the Hirose DF9-31 connector. There are two flavors of the bus, Smartbus Basic with two connector (A+B) and Smartbus Full which add two additional connectors (A+B+C+D). Each connector has 31 pins, which are assigned different purposes. The Smartmaker Wiki has more details on the Smartbus configuration.