>
> Hello everyone! I just purchased an ARMexpress LITE, and have a project going
with it already.
>
> I am trying to interface with an SPI device, and I cannot get the simplest of
things to work in the compiler.
>
> For instance, here is my program:
>
>
> #include
>
> SUB sendData(data)
> str$(0) = data
> 'SPIOUT (CS, CLK, DATA, LSBfirst, 1, str$)
> END SUB
>
>
> And I get the following errors:
>
>
> SUB sendData(data)
> -ERROR In Line PhilipsLCD_testing.bas: 11: parameter error1, found data)
>
> str$(0) = data
> -ERROR In Line PhilipsLCD_testing.bas: 12: Expected Integer Variable or IO,
found (0) = data
>
> SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> -ERROR In Line PhilipsLCD_testing.bas: 13: Expected string variable, found
str$)
>
> SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> -ERROR In Line PhilipsLCD_testing.bas: 13: Expected End Of Line, found str$)
>
> SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> -First ERROR at line :11
>
>
> I just don't get it... If anyone can offer a simple solution to this, I would
be grateful.
> Thank you!
>
I'm sorry, the program is actually
#include
CONST CS = 8
CONST SCLK = 9
CONST SDATA = 10
CONST RST = 11
CONST LSBfirst = 0
CONST MSBfirst = 1
SUB sendData(data)
str$(0) = data
SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
END SUB
reserved words
Re: reserved words
> SUB sendData(data)
> str$(0) = data
> SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> END SUB
>
data is a reserved word
don't worry, a second set of eyes is often useful
change the name to something else
> str$(0) = data
> SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> END SUB
>
data is a reserved word
don't worry, a second set of eyes is often useful
change the name to something else
Re: reserved words
>
>
> > SUB sendData(data)
> > str$(0) = data
> > SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> > END SUB
> >
>
> data is a reserved word
>
> don't worry, a second set of eyes is often useful
>
> change the name to something else
>
Okay, so I changed it to dataOut, and now I still get the error:
-ERROR In Line PhilipsLCD.bas: 22: Expected Integer Variable or IO, found (0) =
"dataOut"
thank you for the help
>
> > SUB sendData(data)
> > str$(0) = data
> > SPIOUT (CS, SCLK, SDATA, LSBfirst, 1, str$)
> > END SUB
> >
>
> data is a reserved word
>
> don't worry, a second set of eyes is often useful
>
> change the name to something else
>
Okay, so I changed it to dataOut, and now I still get the error:
-ERROR In Line PhilipsLCD.bas: 22: Expected Integer Variable or IO, found (0) =
"dataOut"
thank you for the help
Re: reserved words
> change the name to something else
>
Oh jeez, nevermind. I never dim'ed the str$. Thanks again!
>
Oh jeez, nevermind. I never dim'ed the str$. Thanks again!