structure error

General discussion on mikroBasic PRO for PIC32.
Post Reply
Author
Message
relinquished
Posts: 222
Joined: 09 Apr 2011 11:08
Location: ITALY / NAPOLI

structure error

#1 Post by relinquished » 23 Apr 2015 22:38

prejudice to the forum, I might say, why do I get this error?



'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
structure conv
dim X as word
dim Y as word
end structure

structure Cal
dim Xmin as word
dim Xmax as word
dim Ymin as word
dim Ymax as word
end structure

structure def
dim Xmin as word
dim Xmax as word
dim Ymin as word
dim Ymax as word
end structure

structure Display
dim SizeX as word
dim SizeY as word
dim Calibration as cal
dim Conversion as conv
dim Default as def
end structure
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Sub procedure Touch_Init()
sub function Touch_y as word
sub function Touch_x as word
sub function Touch_get_coord(dim byref x,y as word) as byte
sub function Touch_Calibration as byte
sub procedure Conversione()


implements

dim k as byte
get_x, get_y as word[10]
getx,gety as word
flag as bit

Buffers as byte[2]
dummy as byte


'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
sub function ByteToWord(dim ByteH, ByteL as byte) as word
dim t as word
t = ByteH << 8
t =+ ByteL
result = t
end sub
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Sub procedure Touch_Init()
Display.Default.Xmin = 187
Display.Default.Xmax = 1827
Display.Default.Ymin = 256
Display.Default.Ymax = 1837
TpCsDir = 0
TpIrqDir = 1
TpIrq = 1
TpCs = 0
SPI2_Write(%11010100)
Buffers[1] = Spi2_Read(buffers[1])
Buffers[0] = Spi2_Read(buffers[0])
TpCs = 1
end sub


the error is given by this line
Display.Default.Xmin = 187

relinquished
Posts: 222
Joined: 09 Apr 2011 11:08
Location: ITALY / NAPOLI

Re: structure error

#2 Post by relinquished » 23 Apr 2015 22:46

oh well I solved, I had forgotten to declare dim disp as display

Post Reply

Return to “mikroBasic PRO for PIC32 General”