-
Notifications
You must be signed in to change notification settings - Fork 0
1.2 Control Basics
So now that you know that motors have numbers assigned to them, did you know that controllers also have numbers assigned to them?
Imagine a game controller please.
On this controller you have a blue, green, red, and yellow button. X Y A B.
To a computer however these are seen as 1 2 3 4.
So when you press a button on the controller hooked up to your Nintendo, the Nintendo says:
"BUTTON 3 HAS BEEN PRESSED"
"BUTTON 3 IS ASSIGNED TO JUMP"
"MAKE THE CHARACTER JUMP"
It's really as simple as that. But what does this have to do with controlling a motor then?
Well, when you press on a joy stick, unlike a button, it does not have a set ON or OFF. A joystick or slider usually has a range from -1 to 1 and every decimal in between. So when the joystick is pushed halfway away from you it is probably sitting around .5, this is then sent to the motor telling it to go at .5 X 100% of it's max speed