Stepper package provides super simple steps handler and formatter. Copyright (C) 2011 by Krzysztof Kowalik <chris@nu7hat.ch>
Package drv8833 provides a driver for the DRV8833 dual h-bridge chip able to drive DC motors, bipolar steppers, solenoids, and other inductive loads The DRV8833 has a wide power supply range from 2.7v - 10.8v Included are methods that seem appropriate for DC motors Run() & latching solenoids Pulse(), but not steppers Datasheet: https://www.ti.com/lit/ds/symlink/drv8833.pdf Pins IN1 | H-bridge 1 IN2 | H-bridge 1 IN3 | H-bridge 2 IN4 | H-bridge 2 GND | VCC | 3-10v ULT | Low = Sleep; High = Run EEP | Output protection OUT1 | OUT2 | OUT3 | OUT4 | Truth Table (per H-bridge) | IN1 | IN2 | OUT1 | OUT2 | FUNCTION | | --- | --- | ---- | ---- | -------- | | 0 | 0 | Z | Z | Coast / fast decay | | 0 | 1 | L | H | Reverse | | 1 | 0 | H | L | Forward | | 1 | 1 | L | L | Brake / slow decay | PWM Control Truth Table | IN1 | IN2 | Function | | --- | --- | -------- | | PWM | 0 | Forward PWM, fast decay | | 1 | PWM | Forward PWM, slow decay | | 0 | PWM | Reverse PWM, fast decay | | PWM | 1 | Reverse PWM, slow decay |
Access nested properties in Go data structures with Data Queries A query Result is a tuple (result value:any, missed steps:int), if missed steps is 0, the query was successful and the result is OK. Use “assert functions” or “fallback functions” to easily extract an expected type from a query result. Both are based on “convert functions”. The convert function for target type T is func(v any) (r T, err error). If conversion of v fails, err != nil and r is T's zero value. Otherwise, r is the conversion result. Use As to create an assertion function from a convert function. Use Fallback to create a fallback function from a convert function. By convention, convert functions for target type <T> are named To<T>(). Predefined assert functions are named As<T>(), predefined fallback functions <T>Or(). Use Get as the general way to perform queries. Read on to find more specific and efficient ways to query: Index, Field, Key to step with int, string and any. Further SliceAny, DictAny, MapAny to get query results that can be asserted from typical generic Go data. To extend daq to your own types write convert functions and familiarize with Stepper, Slice, Dict and Map. Signed and unsigned integer types are promoted to each other as long as the actual runtime value is in target type's range. Float values are promoted to integer types if the actual float has no fraction, and it is in target type's range. Complex values with imag()==0 are promoted to integer by promoting the real() part according to the float rules.
Stepper is a package that implements thread-safe, in-memory finite state machine. Simple API allows for changing or queuing transitions for user-defined states.