Skip to content

Instantly share code, notes, and snippets.

View shwars's full-sized avatar

Dmitri Soshnikov shwars

View GitHub Profile
open System
let L = 14. // Space between wheels || Your values might be quite different
let R = 2.7 // Wheel's radius ||
let ticksPerRotation = 12000. // ~ amount of ticks is taken by one full rotation
let desiredAngle = int ((L/R/4.) * ticksPerRotation) // Math routine to calculate how many ticks is taken to turn
type Direction = Forward | Backward | Left | Right
// <Twitter boilerplate part>