As the name suggests, the function of this board is to kick and chip.
To make this happen it cycles through the following states:
off
charging is off. If the capacitors are still charged it is able to shootready
capacitor is charged. As the capacitor drains over time it starts charging again after if one of the following conditions is reachedcharging
charge until doneshoot
state right after shooting. kick and chip pins are set to off and state will be changed to off or charging.
The state can go from off
or ready
to shoot
by the function shoot_shoot(). This function also calculates the shooting time. How longer this time is, how harder the ball is kicked.
To get the desired speed the speed needs to be converted shooting time. The recommended method of doing this is manually setting a kickTime in the function claculateShootingTime(), send a kick command via basestation or OLED screen, and checking with vision how fast it goes. Do this for multiple kickTimes and plot it against the speeds recorded. Find the function that (roughly) fits the points plotted and put that in the code.