Here are the errors:Code:
13: Print( "Battery is "$voltageAA )
> Error on line 13: Missing binary operator:
"Battery is " [?] 67
15: Filewriteline( "C:\Users\dylan_000\Desktop\AAlog.txt", $number + 1 ":" $voltageAA)
> Error on line 15: Missing binary operator:
1 [?] ":"
":" [?] 69
Done (00:00:03.7516495)
Here's the script:Code:
:start
$voltageAA = 0
print( "Load battery" )
Sleep(2000)
#Claw closed
servo(d0, 95)
servo(d1, 121)
Sleep(500)
#check and log voltage
$voltageAA = getadc(7)
Print( "Battery is "$voltageAA )
Sleep(300)
Filewriteline( "C:\Users\dylan_000\Desktop\AAlog.txt", $number + 1 ":" $voltageAA)
#claw open
servo(d0, 50)
servo(d1, 150)
Sleep(200)
#door open
servo(d2, 95)
sleep(500)
#door closed
servo(d2, 175)
Goto(start)
What do I have to do to fix them? I'm sure its just my script.
Asked
— Edited
This is wrong:
Code:
This is correct:
Code:
Without it, you would have to begin understanding binary operations - which you don't, hence the question about the error
Code:
to the file. How do I fix that?
It should output
Code:
or similar.
Code:
There has to be a plus sign between each and every separate thing you are trying to combine into one sentence. In this case the + operator is being used in two different ways depending on context. The first one ($number+1), is used as a math addition operator. In the other cases it is being used as an append operator (as DJ mentioned above).
Code:
I added a space with the colon so as to separate the colon from the $voltageAA value in the output, but that has nothing to do with why it didn't work. For instance:
Code:
The spaces between the parts make no difference.