GPIOElement findElement(PinName pin) { foreach (Control c in flowButtons.Controls) { GPIOElement e = c as GPIOElement; if (e.GetDevice().pin == pin) { return(e); } } return(null); }