Hardware driver to interface resistive touch panels with the STM32 microcontroller. More...
Public Member Functions | |
| def | __init__ (self, x_p, x_m, y_p, y_m) |
| Constructs a touch panel object. More... | |
| def | get_x (self) |
| Reads x position. More... | |
| def | get_y (self) |
| Reads y position. More... | |
| def | get_z (self) |
| Reads z "position" and creates a boolean flag for when contact is detected. | |
| def | get_coords (self) |
| Gets x, y, and z positions. More... | |
| def | calibrate (self) |
| Calibrates touch panel. | |
Public Attributes | |
| x_p | |
| Variable for pin reading x-component of contact point. More... | |
| x_m | |
| Variable for pin reading x-component of contact point. More... | |
| y_p | |
| Variable for pin reading y-component of contact point. More... | |
| y_m | |
| Variable for pin reading y-component of contact point. More... | |
| x_width | |
| Variable for width of touch panel. More... | |
| y_length | |
| Variable for length of touch panel. More... | |
| z_ADC_flag | |
| A boolean flag used to detect contact with touch panel. More... | |
| calibrate_flag | |
| A flag used to signal whether the panel has been calibrated or not. More... | |
| beta | |
| Array to define beta values. More... | |
| z_ADC | |
| Uncalibrated z-position values read by touch panel. More... | |
| x_ADC | |
| Uncalibrated x-position values read by touch panel. More... | |
| y_ADC | |
| Uncalibrated y-position values read by touch panel. More... | |
| x_ADC_cal | |
| Calibrated x-position values read by touch panel. More... | |
| y_ADC_cal | |
| Calibrated y-position values read by touch panel. More... | |
| calibrated_pos | |
| Calibrated x and y positions read by panel. More... | |
| uncalibrated_pos | |
| Uncalibrated x and y positions read by panel. More... | |
| panel_coords | |
| Array of panel coordinates. More... | |
| panel_coords_instr | |
| Instructions for user during panel calibration. More... | |
| panel_meas | |
| Empty array for panel measurements. More... | |
| i | |
| A variable used for indexing. More... | |
| touch_coeffs | |
| Array of calculated panel coefficients. More... | |
Hardware driver to interface resistive touch panels with the STM32 microcontroller.
Scans X, Y, and Z components of contact point on touch panel by configuring 4 pin objects
| def LabFF_touch_pan.Touch_Pan.__init__ | ( | self, | |
| x_p, | |||
| x_m, | |||
| y_p, | |||
| y_m | |||
| ) |
Constructs a touch panel object.
The touch panel object is created from four touch panel pins configured to read the touch panel.
| x_p | Used to scan x component from touch panel, configured as a push-pull output |
| x_m | Used to scan x component from touch panel, configured as a push-pull output |
| y_p | Used to scan y component from touch panel, configured as a push-pull output |
| y_m | Used to scan y component from touch panel, configured as a push-pull output |
| def LabFF_touch_pan.Touch_Pan.get_coords | ( | self | ) |
Gets x, y, and z positions.
Returns uncalibrated and calibrated values.
| def LabFF_touch_pan.Touch_Pan.get_x | ( | self | ) |
Reads x position.
Returns uncalibrated values.
| def LabFF_touch_pan.Touch_Pan.get_y | ( | self | ) |
Reads y position.
Returns uncalibrated values.
| LabFF_touch_pan.Touch_Pan.beta |
Array to define beta values.
Used to calibrate the touch panel and account for center offset
| LabFF_touch_pan.Touch_Pan.calibrate_flag |
A flag used to signal whether the panel has been calibrated or not.
Determines which coordinate values (calibrated or not-calibrated) to return
| LabFF_touch_pan.Touch_Pan.calibrated_pos |
Calibrated x and y positions read by panel.
Creates list of positions to be used for state vectors
| LabFF_touch_pan.Touch_Pan.i |
A variable used for indexing.
This value helps index state vector points for calibration
| LabFF_touch_pan.Touch_Pan.panel_coords |
Array of panel coordinates.
Coordinates to be used in panel calibration calculations
| LabFF_touch_pan.Touch_Pan.panel_coords_instr |
Instructions for user during panel calibration.
User touches the listed coordinates for panel calibration
| LabFF_touch_pan.Touch_Pan.panel_meas |
Empty array for panel measurements.
Measured positional coordinates to be used in panel calibration calculations
| LabFF_touch_pan.Touch_Pan.touch_coeffs |
Array of calculated panel coefficients.
Beta values that will be applied to ADC position readings to calibrate touch panel coordinates
| LabFF_touch_pan.Touch_Pan.uncalibrated_pos |
Uncalibrated x and y positions read by panel.
Creates list of uncalibrated positions. Should not be used for ball balancing.
| LabFF_touch_pan.Touch_Pan.x_ADC |
Uncalibrated x-position values read by touch panel.
Measures x-position
| LabFF_touch_pan.Touch_Pan.x_ADC_cal |
Calibrated x-position values read by touch panel.
Measures x-position accurately based on manual or automatic calibration constants
| LabFF_touch_pan.Touch_Pan.x_m |
Variable for pin reading x-component of contact point.
Used to locate touch in x-direction
| LabFF_touch_pan.Touch_Pan.x_p |
Variable for pin reading x-component of contact point.
Used to locate touch in x-direction
| LabFF_touch_pan.Touch_Pan.x_width |
Variable for width of touch panel.
Defines width of panel in the x-direction
| LabFF_touch_pan.Touch_Pan.y_ADC |
Uncalibrated y-position values read by touch panel.
Measures y-position
| LabFF_touch_pan.Touch_Pan.y_ADC_cal |
Calibrated y-position values read by touch panel.
Measures y-position accurately based on manual or automatic calibration constants
| LabFF_touch_pan.Touch_Pan.y_length |
Variable for length of touch panel.
Defines length of panel in the y-direction
| LabFF_touch_pan.Touch_Pan.y_m |
Variable for pin reading y-component of contact point.
Used to locate touch in y-direction
| LabFF_touch_pan.Touch_Pan.y_p |
Variable for pin reading y-component of contact point.
Used to locate touch in y-direction
| LabFF_touch_pan.Touch_Pan.z_ADC |
Uncalibrated z-position values read by touch panel.
Measures z-position (contact with panel)
| LabFF_touch_pan.Touch_Pan.z_ADC_flag |
A boolean flag used to detect contact with touch panel.
Signals to the panel to read values when contact is made