How to control a machine using your mind