Pixel
Source: Positron8 Compiler User Manual, PDF page 271
Syntax
Variable = Pixel Ypos, Xpos
Overview
Read the condition of an individual pixel from a graphic LCD. The returned value will be 1 if the pixel is set, and 0 if the pixel is clear.
Parameters
Variable is a user defined variable. Xpos can be a constant, variable, or expression, pointing to the X-axis location of the pixel to examine. This must be a value of 0 to the X resolution of the LCD. Where 0 is the far left row of pixels. Ypos can be a constant, variable, or expression, pointing to the Y-axis location of the pixel to examine. This must be a value of 0 to the Y resolution of the LCD. Where 0 is the top column of pixels.
Example
' Read a line of pixels from a KS0108 graphic LCD
Device = 16F1829
Declare LCD_Type = KS0108
' Use a KS0108 Graphic LCD
Declare Internal_Font = Off
' Use an external chr set
Declare Font_Addr = 0
' EEPROM's address is 0
'
' Graphic LCD Pin Assignments
'
Declare LCD_DTPort = PORTD
Declare LCD_RSPin = PORTC.2
Declare LCD_RWPin = PORTE.0
Declare LCD_ENPin = PORTC.5
Declare LCD_CS1Pin = PORTE.1
Declare LCD_CS2Pin = PORTE.2
'
' Character set EEPROM Pin Assignments
'
Declare SDA_Pin = PORTC.4
Declare SCL_Pin = PORTC.3
Dim Xpos as Byte
Dim Ypos as Byte
Dim MyResult as Byte
ADCON1 = 7
' PORTA and PORTE to all digital mode
Cls
Print At 0, 0, "Testing 1-2-3"
'
' Read the top row and display the result
'
For Xpos = 0 to 127
MyResult = Pixel 0, Xpos
' Read the top row
Print At 1, 0, Dec MyResult
DelayMs 400
Next
Stop