I had this script working in ez builder with only one board. I added a second board and added a 1. to the beginning of each command in the scripts but now I cant get the ports to turn of or on.
I also get Syntax errors after I've run the scrip a few times and (I dont think) I made any changes.
I also added the .1 in the call scripts "move right" and "move left". Please see each below and let me know what I'm doing wrong:
#Main script:
# This script will move an HBridge to
# the specified ADC value.
1.if ($adcSpecified = 0)
goto(Error)
:Start
1.$adcCurrent = GetADC(adc0)
1.if ($adcCurrent $adcSpecified)
goto(RotateRight)
1.if ($adcCurrent = $adcSpecified)
goto(RotateStop)
goto(Start)
:RotateLeft
1.Set(d1, on)
1.Set(d0, off)
Return()
:RotateRight
1.Set(d1, off)
1.Set(d0, on)
Return()
:RotateStop
1.Set(d1, off)
1.Set(d0, off)
Halt()
:Error
Say("There is no specified position to move too")
------------------------------
#Move Right Script:
# This script will move the motor into the
# right position
1.$adcSpecified = 150
ControlCommand("Hips", scriptStart)
-------------------------------
#Move Left Script:
# This script will move the motor into the
# left position
1.$adcSpecified = 50
ControlCommand("Hips", scriptStart)
Any help is welcomed.
Thanks, Dave Schulpius
Asked
— Edited
I've played with the script and have it turning on at least one of the Digital ports when I start the call scripts. However when I turn the pot the Varible Watch panel showing the "$adccurrent" does not change. It's stays on 1.0. I think this means it's not reading the ADC port of the second board. I still have sonething wrong with the main script. Here's the script as it is now (any help is welcomed):
# This script will move an HBridge to
# the specified ADC value.
if ($adcSpecified = 0)
goto(Error)
:Start
$adcCurrent = 1.GetADC(adc0)
if ($adcCurrent $adcSpecified)
goto(RotateRight)
if ($adcCurrent = $adcSpecified)
goto(RotateStop)
goto(Start)
:RotateLeft
1.Set(d1, on)
1.Set(d0, off)
Return()
:RotateRight
1.Set(d1, off)
1.Set(d0, on)
Return()
:RotateStop
1.Set(d1, off)
1.Set(d0, off)
Halt()
:Error
Say("There is no specified position to move too")