Re: VAR array compile issue
Have a variable like
Then swap the variables in your array.
Your new code will look like below.
Code:
'-------------- Low Address /High Address /Data / Inv Data bytes --------------
For T = 1 to 4
FOR Index = 7 TO 0 step -1 ' Loop for 8 bits data start at bit 7-0 and send
temp = STDByte[T]
IF temp.0[Index] = 0 THEN ' Get polarity of each data bit to send
Space = Zero ' Pulse time = Burst (560us) + Zero (560us) = 1.12mS for a "0" data bit
ELSE
Space = One ' Pulse time = Burst (560us) + One (1680us) = 2.24mS for a "1" data bit
ENDIF
STDByte[T] = temp
GPIO.0 = 0 ' Set Output low
pauseus Burst ' load the burst for 0.56ms
GPIO.0 = 1 ' Set Output high
pauseus space ' High for duration of either Zero or One value ,for each address/data b
Total[T] = Total[T] + space + burst ' store total time of string
NEXT Index ' Loop until 8 data-bits sent of DByte(X)
Next T
Re: VAR array compile issue
thanks Sayzar , but i tried that before i posted , and just then , still get bad expression error and syntax error , using picbasic pro 5.0.0.0 , pbpx 3.0.4.1
is there something i am missing ??
Cheers
sheldon
temp = STDByte[T] - bad expression error
STDByte[T] = temp - syntax error
Re: VAR array compile issue
i think i found the issue i forgot to define dbbyte var when i changed it over from dbyte1, cheers