CALPOLY MECHATRONICS
Documentation for all Mechatronics Labs
ME405_FP_ResTP.ResTP Class Reference

Runs operations and returns values specific to the encoder count. More...

Public Member Functions

def __init__ (self, pin0, pin1, pin6, pin7)
 Assign a pin to each Cartesian coordinate variable (one per sign) More...
 
def x_scan (self)
 Relays positional information in the x-direction. More...
 
def y_scan (self)
 Relays positional information in the y-direction. More...
 
def z_scan (self)
 Detects whether or not an object is in contact with the platform. More...
 
def runScan (self)
 Runs the scan methods and stores the readings in a tuple. More...
 

Public Attributes

 l_p
 
 w_p
 
 cntr_p
 
 x_calib
 Sets the pin to ADC mode and stores the values in the variable "adc" self.adc_XZ = pyb.ADC(self.pin0) # instantiatiing the ADC class with an object self.adc_Y = pyb.ADC(self.pin1)
 
 y_calib
 
 x_scale
 
 y_scale
 

Static Public Attributes

 pin0 = None
 
 pin1 = None
 
 pin6 = None
 
 pin7 = None
 
int l_p = 0
 
int w_p = 0
 
list cntr_p = [0, 0]
 
float splyVlt = 3.3
 

Detailed Description

Runs operations and returns values specific to the encoder count.

Class for updating, getting, setting, and computing the change in the encoder count.

Constructor & Destructor Documentation

◆ __init__()

def ME405_FP_ResTP.ResTP.__init__ (   self,
  pin0,
  pin1,
  pin6,
  pin7 
)

Assign a pin to each Cartesian coordinate variable (one per sign)

The initialization also includes calibrating the touch panel so that results start from (0,0), and priming the pins so that they read in ADC mode, which will allow us to interpret voltage differences that indicate the presence of an object

Member Function Documentation

◆ runScan()

def ME405_FP_ResTP.ResTP.runScan (   self)

Runs the scan methods and stores the readings in a tuple.

Returns
Tuple_ScanVal The value of the x-, y-, and z-scans as quickly as the touch panel cycles

◆ x_scan()

def ME405_FP_ResTP.ResTP.x_scan (   self)

Relays positional information in the x-direction.

By detecting voltage changes (via ADC method) brought about by the contact of two paths of wires oriented vertically to one another, the position of an object on the platform in the x-direction can be detected.

Returns
x_pos*self.x_scale The x-position scaled to place (0,0) at the platforms center

◆ y_scan()

def ME405_FP_ResTP.ResTP.y_scan (   self)

Relays positional information in the y-direction.

Delivers y-position information of a object on the touch panel using an identical conversion of voltage to count via an ADC pin as the x-scan method.

Returns
y_pos*self.y_scale The y-position scaled to place (0,0) at the platforms center

◆ z_scan()

def ME405_FP_ResTP.ResTP.z_scan (   self)

Detects whether or not an object is in contact with the platform.

Uses the voltage to count conversion via ADC, but employs it to ensure there is contact with the touch panel. The panel is set to read high, therefore when a count value is detected that is below the max count multiplied by some FOS, this implies that contact with the panel is present.

Returns
A boolean True/False to indicate whether there is contact with the panel

The documentation for this class was generated from the following file: