added GPIO read function