Ive been working with two script one move a conveyer depending on the proximity sensor state and for that i used the sysCall_sensing() function.
Now i want to go there with my robot but i can seem to be able to communicate between the scripts since the sensordetection variable doesnt work outside of the function sysCall_sensing or so i think.
Any ideas on how i can call that function on the robot script?
script communication
Re: script communication
Hello,
you have many different ways to share information between scripts or the outside world. Signals are probably the easiest.
Cheers
you have many different ways to share information between scripts or the outside world. Signals are probably the easiest.
Cheers
Re: script communication
now i have a different problem, when i pass a 0 to the conveyer it runs and when i pass a 1 it stops, even tough it works, when i am in 0 it doesnt change to 1 and when i am in 1 it doesnt change to 0 its weird to explain but what im trying to say is that once it is in a a state it doesnt change to other.(doesnt update the state)
Code: Select all
teste=sim.getFloatSignal("ok")
if teste==0 then
beltVelocity=sim.setFloatSignal("conveyorBeltVelocity",0.05)
else
if teste==1 then
beltVelocity=sim.setFloatSignal("conveyorBeltVelocity",0)
end
end
Re: script communication
now i have a different problem, when i pass a 0 to the conveyer it runs and when i pass a 1 it stops, even tough it works, when i am in 0 it doesnt change to 1 and when i am in 1 it doesnt change to 0 its weird to explain but what im trying to say is that once it is in a a state it doesnt change to other.(doesnt update the state)coppelia wrote: ↑11 Feb 2020, 15:02 Hello,
you have many different ways to share information between scripts or the outside world. Signals are probably the easiest.
Cheers
Code: Select all
teste=sim.getFloatSignal("ok")
if teste==0 then
beltVelocity=sim.setFloatSignal("conveyorBeltVelocity",0.05)
else
if teste==1 then
beltVelocity=sim.setFloatSignal("conveyorBeltVelocity",0)
end
end