Switch-like proteins inspired by transistors