Position/velocity finder for the ball. More...
Public Member Functions | |
def | __init__ (self, debugFlag=True) |
Create a touch panel task. More... | |
def | tchPanelFcn (self) |
State machine for running the touch panel driver. More... | |
def | transitionTo (self, state, newState) |
Method for transitioning states. More... | |
Public Attributes | |
touchPanel | |
Create an instance of the touch panel driver. More... | |
debugFlag | |
Debugging flag for detailed analysis while running. | |
lastPosition | |
The last position of the ball (X, Y, Z coordinates). | |
Static Public Attributes | |
S0_INIT = const(0) | |
The initial state to set up the task. | |
S1_READ_PANEL = const(1) | |
Main state to read from the panel. | |
Position/velocity finder for the ball.
This class will allow for the position and velocity of the ball to be calculated using the resisive touch pad.
def touchPanelTask.touchPanelTask.__init__ | ( | self, | |
debugFlag = True |
|||
) |
Create a touch panel task.
This task will be called from the priority scheduler to read from the resistive touch panel (through touchPanelDriver.py) in order to find the position and velocity of the ball. This data will be shared with shares.py.
debugFlag | Enables or prevents certain print statements from appearing. |
def touchPanelTask.touchPanelTask.tchPanelFcn | ( | self | ) |
State machine for running the touch panel driver.
This generator is used to run the touch panel task. The main states are initializing the touch panel (including determining whether or not the ball is on the platform), and running the drivers to filter the position and speed.
def touchPanelTask.touchPanelTask.transitionTo | ( | self, | |
state, | |||
newState | |||
) |
Method for transitioning states.
The method will reassign the state
variable when directed to transition.
state | The current state of the system. |
newState | The new desired state for the system. |
touchPanelTask.touchPanelTask.touchPanel |
Create an instance of the touch panel driver.
This object needs the pin values for the xm, xp, ym, and yp ports on the resistive touch panel. These must be passed in as such Pin.cpu.##
. Also, the length of the board, width of the board, and the coordinates of the center location must be passed in.