10-30-2019, 07:35 AM
maiden Wrote:haha, ment code running on device
Sorry, realized that after posting the code.
It was written in Go using TinyGo. Much of the code is a bit of a mess and depends on non-upstreamed changes. I'll post the code once it is ready.
Conceptually, it just measures the voltage using the ADC on pin 31 (AIN7) with the following settings:
- reference voltage: internal (0.6V)
- gain set to 1/5
- positive/negative channel resistors bypassed
- acquisition time 3µs
- single ended mode