PiStorms  4.012
PiStorms Library Reference by mindsensors.com
 All Classes Namespaces Files Functions Variables
mindsensorsUI.mindsensorsUI Class Reference

mindsensorsUI: this class provides functions for touchscreen LCD on mindsensors.com products for read and write operations. More...

Public Member Functions

def __init__
 Initialize the UI device. More...
 
def dumpTerminal
 Dumps the screen buffer. More...
 
def setMode
 Sets the mode (Experienced users) More...
 
def getMode
 Returns the value of the mode (Experienced users) More...
 
def calibrateTouched
 Sets the expected X,Y when the screen is not touched to their current values (Experienced users) More...
 
def fillRoundRect
 Draw a rectangle with rounded edges on the screen (rotated to screen) More...
 
def screenXFromImageCoords
 Calculates the x-coordinate of the screen upon rotation (INTERNAL USE ONLY) More...
 
def screenYFromImageCoords
 Calculates the y-coordinate of the screen upon rotation(INTERNAL USE ONLY) More...
 
def TS_To_ImageCoords_X
 Calculates display x-coordinate from touchscreen values, adjusted for rotation (INTERNAL USE ONLY) More...
 
def TS_To_ImageCoords_Y
 Calculates display y-coordinate from touchscreen values, adjusted for rotation (INTERNAL USE ONLY) More...
 
def draw_rotated_text
 Displays rotated text (INTERNAL USE ONLY) More...
 
def screenWidth
 Determines the width of the screen based on rotation (Experienced users) More...
 
def screenHeight
 Determines the height of the screen based on rotation (Experienced users) More...
 
def drawDisplay
 Prints the name text on the screen, intended for terminal mode. More...
 
def drawArrows
 Draw forward and back arrows on the screen. More...
 
def checkArrows
 Determine if either on screen arrow button is pressed. More...
 
def hideArrows
 Hide the on screen arrow buttons. More...
 
def showArrows
 Show the on screen arrow buttons. More...
 
def calculateButton
 Determines if button in a pop-up window is pressed (Experienced users) More...
 
def getTouchscreenValues
 Returns a tuple of the x and y touchscreen coordinates, or (0,0) if the screen is not touched. More...
 
def TS_X
 Reads the x-coordinate of the touchscreen press. More...
 
def TS_Y
 Reads the y-coordinate of the touchscreen press. More...
 
def RAW_X
 Reads the raw touchscreen x-value (INTERNAL USE ONLY) More...
 
def RAW_Y
 Reads the raw touchscreen y-value (INTERNAL USE ONLY) More...
 
def isTouched
 Detects touchscreen presses and prevents false positives. More...
 
def clearScreen
 Clears the LCD screen to defualt black. More...
 
def fillRect
 Draw a rectangle on the screen (rotated to screen) More...
 
def fillCircle
 Draw a circle on the screen (rotated to screen) More...
 
def fillBmp
 Draw a bitmap image on the screen (.png files rcommended) More...
 
def fillImgArray
 Draw a image on the screen using supplied image data. More...
 
def rotateRight
 Rotates the screen orientation 90 degrees to the right (-90 degrees) More...
 
def rotateLeft
 Rotates the screen orientation 90 degrees to the left (90 degrees) More...
 
def drawAutoText
 Displays text on the screen with adjusted position and rotation. More...
 
def termGotoLine
 Set the cursor to a specific line of the of the screen. More...
 
def termCheckCursorValid
 Check if a cursor position (or the current cursor position) is valid. More...
 
def termClearLine
 Clear a terminal line. More...
 
def termPrintAt
 Print to a specific line of the screen. More...
 
def termPrint
 Print to the current line of the screen. More...
 
def termPrintln
 Print to the current line and then go to the next line. More...
 
def termReplaceLastLine
 Print new text in place of last line. More...
 
def refreshLine
 Draw a terminal text line to the screen. More...
 
def drawButton
 Draw a labeled button on the screen (INTERNAL USE ONLY) More...
 
def refresh
 Refresh the screen (Slow) More...
 
def checkButton
 Determine if an on screen button is pressed. More...
 
def askQuestion
 Display pop-up of a question on the screen. More...
 
def askYesOrNoQuestion
 Display Pop-up of 'Yes' or 'No' question on the screen, returning True or False. More...
 
def showMessage
 Display pop-up of a message on the screen with a single option "OK". More...
 
def forceMessage
 Display pop-up of a message on the screen with no exit options. More...
 
def drawLine
 Draw a line on the screen (rotated to screen) More...
 
def drawPolyLine
 Draw a polyline on the screen (rotated to screen) More...
 

Public Attributes

 PS_ADDRESS
 
 PS_TSX
 
 PS_TSY
 
 i2c
 
 mutex
 
 touchIgnoreX
 
 touchIgnoreY
 
 currentRotation
 
 myname
 
 ts_cal
 
 terminalBuffer
 
 terminalCursor
 
 currentMode
 
 drawArrowsbool
 
 popupText
 
 buttonText
 

Static Public Attributes

int PS_ADDRESS = 0x34
 Default Device I2C Address.
 
int PS_TSX = 0xE3
 Touchscreen X-axis Register. More...
 
int PS_TSY = 0xE5
 Touchscreen Y-axis Register. More...
 
int PS_RAWX = 0xE7
 Touchscreen Y-axis Raw Register. More...
 
int PS_RAWY = 0xE9
 Touchscreen Y-axis Raw Register. More...
 
tuple PS_BLACK = (0,0,0)
 Constant to specify black color.
 
tuple PS_BLUE = (0,0,255)
 Constant to specify blue color.
 
tuple PS_RED = (255,0,0)
 Constant to specify red color.
 
tuple PS_GREEN = (0,255,0)
 Constant to specify green color.
 
tuple PS_CYAN = (0,255,255)
 Constant to specify cyan color.
 
tuple PS_MAGENTA = (255,0,255)
 Constant to specify magenta color.
 
tuple PS_YELLOW = (255,255,0)
 Constant to specify yellow color.
 
tuple PS_WHITE = (255,255,255)
 Constant to specify white color.
 
int PS_SCREENWIDTH = 240
 Constant to defualt screen width.
 
int PS_SCREENHEIGHT = 320
 Constant to defualt screen height.
 

Detailed Description

mindsensorsUI: this class provides functions for touchscreen LCD on mindsensors.com products for read and write operations.

There is no need to initialize this class unless using the LCD screen alone. Normal initialization will be performed automatically with initialization of the Device on which the screen is used.

Constructor & Destructor Documentation

def mindsensorsUI.mindsensorsUI.__init__ (   self,
  name = "PiStorms",
  rotation = 3,
  device = Dev_PiStorms 
)

Initialize the UI device.

Parameters
selfThe object pointer.
nameThe display title that will appear at the top of the LCD touchscreen. Optional, defaults to "PiStorms" (unused).
rotationThe rotation of the LCD touchscreen. Optional, defaults to 3 (standard rotation).
deviceThe device on which the LCD touchscreen is used. Optional, defaults to PiStorms.
Remarks
There is no need to use this function directly. To initialize the mindsensorsUI class in your program:
1 from mindsensorsUI import mindsensorsUI
2 ...
3 screen = mindsensorsUI()

Member Function Documentation

def mindsensorsUI.mindsensorsUI.askQuestion (   self,
  question,
  options,
  touch = True,
  goBtn = False 
)

Display pop-up of a question on the screen.

Parameters
selfThe object pointer.
questionThe question that will pop-up on the screen. The first string will be the titlebar.
optionsThe possible answers to the question.
touchWhether to check if the on screen buttons are pressed. Optional, defaults to True.
goBtnWhether to check for the GO button to close the question. Optional, defaults to False.
Note
If goBtn is True, pressing GO will close the dialog and return -1
Remarks
To use this function in your program:
1 ...
2 answer = screen.askQuestion(["Color Picker", "Pick a color!"], ["Red", "Green", "Blue"])
def mindsensorsUI.mindsensorsUI.askYesOrNoQuestion (   self,
  question,
  touch = True,
  goBtn = False 
)

Display Pop-up of 'Yes' or 'No' question on the screen, returning True or False.

Parameters
selfThe object pointer.
questionThe question that will pop-up on the screen.
touchWhether to check if on screen buttons are pressed. Optional, defaults to True.
goBtnWhether to check for the GO button to close the question. Optional, defaults to False.
Note
If goBtn is True, pressing GO will close the dialog and return False
Remarks
To use this function in your program:
1 ...
2 answer = screen.askYesOrNoQuestion(["Continue?", "Do you want to continue?"])
def mindsensorsUI.mindsensorsUI.calculateButton (   self,
  xbuff,
  ybuff,
  buttHeight 
)

Determines if button in a pop-up window is pressed (Experienced users)

Parameters
selfThe object pointer.
xbuffThe x-coordinate buffer.
ybuffThe y-coordinate buffer.
buttHeightThe height of the button.
def mindsensorsUI.mindsensorsUI.calibrateTouched (   self)

Sets the expected X,Y when the screen is not touched to their current values (Experienced users)

Parameters
selfThe object pointer.
def mindsensorsUI.mindsensorsUI.checkArrows (   self)

Determine if either on screen arrow button is pressed.

Parameters
selfThe object pointer.
def mindsensorsUI.mindsensorsUI.checkButton (   self,
  x,
  y,
  width = 150,
  height = 50 
)

Determine if an on screen button is pressed.

Parameters
selfThe object pointer.
xThe upper left x-coordinate of the button.
yThe upper left y-coordinate of the button.
widthThe width of the button. Optional, defaults to 150.
heightThe height of the button. Optional, defaults to 50.
Remarks
To use this function in your program:
1 ...
2 button = screen.checkButton(0,0,50,50)
def mindsensorsUI.mindsensorsUI.clearScreen (   self,
  display = True 
)

Clears the LCD screen to defualt black.

Parameters
selfThe object pointer.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True. To use this function in your program:
1 ...
2 screen.clearScreen()
def mindsensorsUI.mindsensorsUI.draw_rotated_text (   self,
  image,
  text,
  position,
  angle,
  font,
  fill = (255,255,
  display = True 
)

Displays rotated text (INTERNAL USE ONLY)

Parameters
selfThe object pointer.
imageThe image used for creating text
textThe text to display on the screen
positionThe position of the text as a set of x and y-coordinates
angleThe angle at which to rotate the text
fontThe font of the text
fillThe color of the text. Optional, defaults to white.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
def mindsensorsUI.mindsensorsUI.drawArrows (   self,
  display = True 
)

Draw forward and back arrows on the screen.

Parameters
selfThe object pointer.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
def mindsensorsUI.mindsensorsUI.drawAutoText (   self,
  text,
  x,
  y,
  fill = (255,255,
  size = 20,
  align = "left",
  display = True 
)

Displays text on the screen with adjusted position and rotation.

Parameters
selfThe object pointer.
textThe text to display on the screen
xThe upper left x coordinate of the text. Optional, defaults to "left". Irrelevant if align is "center"
yThe upper left y coordinate of the text.
fillThe color of the text. Optional, defaults to white.
sizeThe pixel size of the text. Optional, defaults to 20.
alignThe text alignment, "left" or "center" or "right". Optional, defaults to "left".
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.drawAutoText("Wow!", 10, 20, fill = (255,255,255), size = 25)
def mindsensorsUI.mindsensorsUI.drawButton (   self,
  x,
  y,
  width,
  height,
  prefix = "btns_",
  text = "OK",
  display = True,
  align = "left",
  image = None,
  imageX = None,
  imageY = None 
)

Draw a labeled button on the screen (INTERNAL USE ONLY)

Parameters
selfThe object pointer.
xThe upper left x coordinate of the rectangle.
yThe upper left y coordinate of the rectangle.
widthThe width of the button.
heightThe height of the button.
prefixThe button images filename prefix. Optional, defaults to "btns_"
textThe button label. Defaults to "OK"
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
alignThe alignment for the button's text label.
imageAn optional image to be included on the button, should be 32x32.
imageXThe x-coordinate of the optional image icon.
imageYThe y-coordinate of the optional image icon.
def mindsensorsUI.mindsensorsUI.drawDisplay (   self,
  name,
  display = True 
)

Prints the name text on the screen, intended for terminal mode.

Parameters
selfThe object pointer.
nameThe display title that will appear at the top of the LCD touchscreen.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
def mindsensorsUI.mindsensorsUI.drawLine (   self,
  x1,
  y1,
  x2,
  y2,
  width = 0,
  fill = (255,255,
  display = True 
)

Draw a line on the screen (rotated to screen)

Parameters
selfThe object pointer.
x1,y1,x2,y2The x and y coordinates of each endpoint of the line.
widthThe width of the line. Optional, defaults to 0.
fillThe color of line. Optional, defaults to white.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.drawLine(50, 50, 100, 100, width = 0, fill = (255,0,0))
def mindsensorsUI.mindsensorsUI.drawPolyLine (   self,
  endpoints,
  width = 0,
  fill = (255,255,
  display = True 
)

Draw a polyline on the screen (rotated to screen)

Parameters
selfThe object pointer.
endpoints[x1, y1, x2, y2...] The x and y coordinates of each endpoint of the polyline.
widthThe width of the polyline. Optional, defaults to 0.
fillThe color of polyline. Optional, defaults to white.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.drawLine([50, 50, 100, 50, 100, 100], width = 0, fill = (255,0,0))
def mindsensorsUI.mindsensorsUI.dumpTerminal (   self,
  display = True 
)

Dumps the screen buffer.

Parameters
selfThe object pointer.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
def mindsensorsUI.mindsensorsUI.fillBmp (   self,
  x,
  y,
  width,
  height,
  path = "/usr/local/mindsensors/images/Pane1.png",
  display = True 
)

Draw a bitmap image on the screen (.png files rcommended)

Parameters
selfThe object pointer.
xThe upper left x coordinate of the image.
yThe upper left y coordinate of the image.
widthThe width of the image.
heightThe width of the image.
pathThe image file path. Optional, defaults to the popup background image.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.screen.fillBmp(30, 0, 240, 240, path = os.path.join(currentdir, "dog.png"))
def mindsensorsUI.mindsensorsUI.fillCircle (   self,
  x,
  y,
  radius,
  fill = (255,255,
  display = True 
)

Draw a circle on the screen (rotated to screen)

Parameters
selfThe object pointer.
xThe center x coordinate of the circle.
yThe center y coordinate of the circle.
radiusThe radius of the circle.
fillThe color of the inside of the circle. Optional, defaults to white.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.fillCircle(100, 100, 15, fill = (255,0,0))
def mindsensorsUI.mindsensorsUI.fillImgArray (   self,
  x,
  y,
  width,
  height,
  image,
  display = True 
)

Draw a image on the screen using supplied image data.

Parameters
selfThe object pointer.
xThe upper left x coordinate of the image.
yThe upper left y coordinate of the image.
widthThe width of the image.
heightThe width of the image.
imagedata
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.screen.fillBmp(40, 0, 240, 240, image)
def mindsensorsUI.mindsensorsUI.fillRect (   self,
  x,
  y,
  width,
  height,
  fill = (255,255,
  outline = None,
  display = True 
)

Draw a rectangle on the screen (rotated to screen)

Parameters
selfThe object pointer.
xThe upper left x coordinate of the rectangle.
yThe upper left y coordinate of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.
fillThe color of inside of the rectangle. Optional, defaults to white.
outlineThe color of the outer edge of the rectangle. Optional, defaults to no outline.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.fillRect(100, 100, 75, 75, fill = (255,0,0), outline = (0,0,0))
def mindsensorsUI.mindsensorsUI.fillRoundRect (   self,
  x,
  y,
  width,
  height,
  radius,
  fill = (255,255,
  display = True 
)

Draw a rectangle with rounded edges on the screen (rotated to screen)

Parameters
selfThe object pointer.
xThe upper left x coordinate of the rectangle.
yThe upper left y coordinate of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.
radiusThe arc of the rectangle corners.
fillThe color of the inside of the rectangle. Optional, defaults to white.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
def mindsensorsUI.mindsensorsUI.forceMessage (   self,
  message 
)

Display pop-up of a message on the screen with no exit options.

This function will return right away. You may need to call screen.setMode(screen.PS_MODE_TERMINAL) to stop the popup later.

Parameters
selfThe object pointer.
messageThe message that will pop-up on the screen.
Remarks
To use this function in your program:
1 ...
2 screen.forceMessage(["Processing", "Processing, please wait..."])
def mindsensorsUI.mindsensorsUI.getMode (   self)

Returns the value of the mode (Experienced users)

Parameters
selfThe object pointer.
def mindsensorsUI.mindsensorsUI.getTouchscreenValues (   self)

Returns a tuple of the x and y touchscreen coordinates, or (0,0) if the screen is not touched.

Parameters
selfThe object pointer.
Remarks
To use this function in your program:
1 ...
2 x, y = screen.getTouchscreenValues()
def mindsensorsUI.mindsensorsUI.hideArrows (   self,
  refresh = True 
)

Hide the on screen arrow buttons.

Parameters
selfThe object pointer.
refreshChoose to immediately refresh screen.
def mindsensorsUI.mindsensorsUI.isTouched (   self)

Detects touchscreen presses and prevents false positives.

Parameters
selfThe object pointer. To use this function in your program:
1 ...
2 touch = screen.isTouched()
def mindsensorsUI.mindsensorsUI.RAW_X (   self)

Reads the raw touchscreen x-value (INTERNAL USE ONLY)

Parameters
selfThe object pointer.
def mindsensorsUI.mindsensorsUI.RAW_Y (   self)

Reads the raw touchscreen y-value (INTERNAL USE ONLY)

Parameters
selfThe object pointer.
def mindsensorsUI.mindsensorsUI.refresh (   self)

Refresh the screen (Slow)

Parameters
selfThe object pointer.
Remarks
To use this function in your program:
1 ...
2 screen.refresh()
def mindsensorsUI.mindsensorsUI.refreshLine (   self,
  lineNum,
  display = True 
)

Draw a terminal text line to the screen.

Parameters
selfThe object pointer.
lineNumThe line number at which to refresh.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.refreshLine(1)
def mindsensorsUI.mindsensorsUI.rotateLeft (   self)

Rotates the screen orientation 90 degrees to the left (90 degrees)

Parameters
selfThe object pointer.
Remarks
To use this function in your program:
1 ...
2 screen.rotateLeft()
def mindsensorsUI.mindsensorsUI.rotateRight (   self)

Rotates the screen orientation 90 degrees to the right (-90 degrees)

Parameters
selfThe object pointer.
Remarks
To use this function in your program:
1 ...
2 screen.rotateRight()
def mindsensorsUI.mindsensorsUI.screenHeight (   self)

Determines the height of the screen based on rotation (Experienced users)

Parameters
selfThe object pointer.
def mindsensorsUI.mindsensorsUI.screenWidth (   self)

Determines the width of the screen based on rotation (Experienced users)

Parameters
selfThe object pointer.
def mindsensorsUI.mindsensorsUI.screenXFromImageCoords (   self,
  x = 0,
  y = 0 
)

Calculates the x-coordinate of the screen upon rotation (INTERNAL USE ONLY)

Parameters
selfThe object pointer.
xThe x-coordinate.
yThe y-coordinate.
def mindsensorsUI.mindsensorsUI.screenYFromImageCoords (   self,
  x = 0,
  y = 0 
)

Calculates the y-coordinate of the screen upon rotation(INTERNAL USE ONLY)

Parameters
selfThe object pointer.
xThe x-coordinate.
yThe y-coordinate.
def mindsensorsUI.mindsensorsUI.setMode (   self,
  mode = 0 
)

Sets the mode (Experienced users)

Parameters
selfThe object pointer.
modeThe new mode: PS_MODE_TERMINAL, PS_MODE_POPUP, or PS_MODE_DEAD. Optional, defaults to PS_MODE_TERMINAL.
def mindsensorsUI.mindsensorsUI.showArrows (   self,
  refresh = True 
)

Show the on screen arrow buttons.

Parameters
selfThe object pointer.
refreshChoose to immediately refresh screen.
def mindsensorsUI.mindsensorsUI.showMessage (   self,
  message,
  touch = True,
  goBtn = True 
)

Display pop-up of a message on the screen with a single option "OK".

Parameters
selfThe object pointer.
messageThe message that will pop-up on the screen.
touchWhether to check if on screen buttons are pressed. Optional, defaults to True.
goBtnWhether to check for the GO button to close the question. Optional, defaults to True.
Note
If goBtn is True, pressing GO will close the dialog and return False
Remarks
To use this function in your program:
1 ...
2 answer = screen.showMessage(["Complete", "The process has completed.", "Status: success"])
def mindsensorsUI.mindsensorsUI.termCheckCursorValid (   self,
  lineno = None 
)

Check if a cursor position (or the current cursor position) is valid.

Parameters
linenoWhich line to check if is is valid. If no argument is provided, check the current cursor position.
def mindsensorsUI.mindsensorsUI.termClearLine (   self,
  lineno,
  visualOnly = False,
  display = True 
)

Clear a terminal line.

Parameters
linenoThe line number at which to clear.
visualOnlyChoose to clear the space on screen but not modify the terminal buffer. Optional, defaults to False.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
def mindsensorsUI.mindsensorsUI.termGotoLine (   self,
  lineno 
)

Set the cursor to a specific line of the of the screen.

Parameters
selfThe object pointer.
linenoThe line number at which to set the cursor.
Remarks
To use this function in your program:
1 ...
2 screen.termGotoLine(5)
def mindsensorsUI.mindsensorsUI.termPrint (   self,
  text,
  display = True 
)

Print to the current line of the screen.

Parameters
selfThe object pointer.
textThe text to print to the screen.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.termPrint("Print Now")
def mindsensorsUI.mindsensorsUI.termPrintAt (   self,
  lineno,
  text,
  display = True 
)

Print to a specific line of the screen.

This will not affect the current cursor position.

Parameters
selfThe object pointer.
linenoThe line number at which to set the cursor.
textThe text to print to the screen.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.termPrintAt(5, "Printing at line 5")
def mindsensorsUI.mindsensorsUI.termPrintln (   self,
  text,
  display = True 
)

Print to the current line and then go to the next line.

Parameters
selfThe object pointer.
textThe text to print to the screen.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.termPrintln("Print Now")
def mindsensorsUI.mindsensorsUI.termReplaceLastLine (   self,
  text,
  display = True 
)

Print new text in place of last line.

This will not affect the current cursor position.

Parameters
selfThe object pointer.
textThe text to print to the screen.
displayChoose to immediately push the drawing to the screen. Optional, defaults to True.
Remarks
To use this function in your program:
1 ...
2 screen.termReplaceLastLine("Print Now")
def mindsensorsUI.mindsensorsUI.TS_To_ImageCoords_X (   self,
  x,
  y 
)

Calculates display x-coordinate from touchscreen values, adjusted for rotation (INTERNAL USE ONLY)

Parameters
selfThe object pointer.
xThe x-coordinate.
yThe y-coordinate.
def mindsensorsUI.mindsensorsUI.TS_To_ImageCoords_Y (   self,
  x,
  y 
)

Calculates display y-coordinate from touchscreen values, adjusted for rotation (INTERNAL USE ONLY)

Parameters
selfThe object pointer.
xThe x-coordinate.
yThe y-coordinate.
def mindsensorsUI.mindsensorsUI.TS_X (   self)

Reads the x-coordinate of the touchscreen press.

Parameters
selfThe object pointer.
Remarks
To use this function in your program:
1 ...
2 x = screen.TS_X()
def mindsensorsUI.mindsensorsUI.TS_Y (   self)

Reads the y-coordinate of the touchscreen press.

Parameters
selfThe object pointer. To use this function in your program:
1 ...
2 y = screen.TS_Y()

Member Data Documentation

int mindsensorsUI.mindsensorsUI.PS_RAWX = 0xE7
static

Touchscreen Y-axis Raw Register.

int mindsensorsUI.mindsensorsUI.PS_RAWY = 0xE9
static

Touchscreen Y-axis Raw Register.

int mindsensorsUI.mindsensorsUI.PS_TSX = 0xE3
static

Touchscreen X-axis Register.

Will return an unsigned integer reading (0-340)

int mindsensorsUI.mindsensorsUI.PS_TSY = 0xE5
static

Touchscreen Y-axis Register.

Will return an unsigned integer reading (0-440)


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