Ported over the ADC code to the PCB