Skip to content

1.2 Control Basics

Important Yogurt edited this page Jan 18, 2016 · 3 revisions

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. These are also known as 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 (aka True / False or Boolean). A joystick or slider usually has a range from -1 to 1 and every decimal (aka Doubles). So when the joystick is pushed halfway away from you it is probably sitting around .5, and when it is pulled a third of the way towards you then it's at around .333.

Clone this wiki locally