loading
 
vb script
pratim from India  [1 posts]
12 year
i am having problem with the vb script program.  i want to make a simple ball following robot using vision processing in roborealm.. i hav added the RGB filters, COG. but i am unable to run my vb script program..
here is the program that i have written..


xaxis=Getvariable("COG_X")
objsize=GetVariable("COG_BOX_SIZE")

if (objsize>10) then

if (xaxis>160) then
SetVariable "pin2",0
SetVariable "pin5",1


Else if(x axis<160) then
Set Variable "pin2",1
Set Variable "pin5",0


end if

please find out what is wrong with the program..
please help me out at the earliest...
Anonymous 11 year
You had several issues with your script. Missing 'end if', 'Set Variable' is one word. Perhaps you would prefer the CScript module? Your style seems more C like. Regardless, see if this version helps

xaxis=Getvariable("COG_X")
objsize=GetVariable("COG_BOX_SIZE")

if objsize>10 then
  if xaxis>160 then
    SetVariable "pin2",0
    SetVariable "pin5",1
  Elseif axis<160 then
    SetVariable "pin2",1
    SetVariable "pin5",0
  end if
end if

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index