Use parseports function for digital input