It will run a motor for 2 seconds when the space bar is pressed followed by enter.
I want to make it simpler for students so they don’t need to worry about classes. Any ideas. Also is there a simple way to get the motor to work by pressing the spacebar without having to then press the enter key?
Instantiation creates the object to work with, and it also does a little hardware configuration, confirms that the BrickPi3 is connected, and ensures it is running a version of firmware compatible with the Python drivers.
If you don’t want to have to explain what BP = brickpi3.BrickPi3() does, perhaps just group it with import brickpi3 and explain it as “a necessary line of code to use the BP3”.