Understanding the program

Hello,

I have a hexapod that is properly working. I used the program h2prog01.bas.
The thing is that I don’t understand everything that is written in the program. And I want to write my own programs for my future projects
I’ve searched in the manual but some terms are not explained.
Does someone wants to explain me about the code?

Already many thanks


;-------------Constants
;PS2 Controller / BotBoard II
DAT con P12
CMD con P13
SEL con P14
CLK con P15
SSC32 con p8

DeadZone con 28 ; must be >= 28
PadMode con $79 ; Dualshock2 mode, use $73 with a Dualshock1

I don’t understand what that DeadZone is doing there…
Can someone explain what DeadZone is?


;Pan & Tilt
PanPin con 28
PanNeutral con 1500
PanRange con 500
TiltPin con 29
TiltNeutral con 1500
TiltRange con 500

What are all those Pans and Tilts?

**DeadZone **is the tolerance of the PS2.
PS2 joysticks have a large deadzone in the center of the joystick, an area where no data is sent. Deadzone is how far you move the stick to left or right before it starts moving. Say theres a deadzone of 5mm, you have to move the stick left or right 5mm before it starts responding.

DeadZone con 28 ; must be >= 28 is saying the deadzone cannot be larger than 28.

panpin: is the connection of the pin number
PanNeutral: is the center, point of the rotation… “0 - zero”
PanRange: is how far it will move (min/max range)

Close… The dead band must be larger than 28. The deadband is a threshold amount. The program needs to know if the bot is being told to walk or not. The sticks will report slightly different values (noise) even if the sticks are not moving. This deadband makes sure the sticks are really being moved so the program can act on the change, and ignore noise. Too much dead band and you lose resolution, too little and you risk having the program react when it shouldn’t.

:blush:
>

typo, thats my only excuse. :laughing: