This project implements the core independent peripherals of the Attiny817 to get a fully autonomous time of flight measured distance using a ultrasound transducer. The AVR core is used to set up the device, and outputs the distance in cm on the OLED screen available on the designed hardware. The PCB also contains a temperature sensor that is used to set the correct speed of sound for distance calculations. The temperature sensor is sampled autonomously by the ADC and fires interrupt when temperature is outside of an allowed window, where the used speed of sound is updated.
An optimized version is currently under 1kB of flash when using the IAR workbench and will work with the kickstarter license.