added ADC read function