'while loop' is not running

4 posts / 0 new
Last post
Mr.Sukru
Mr.Sukru's picture
'while loop' is not running

while [$(RSM_SOUND_LEFT) = "1"]

do

./Left_Hand_Shake.sh

/usr/bin/robot/scripts/time_delay.sh 1000

done

Thanks.

Chris 22
Chris 22's picture

It sounds faulty. Change them. I think its the best way.

Nocturnal
Nocturnal's picture

Its been a while, so I'm not even sure the way your testing the sensor will work, but, unless I am mistaken, RSM_SOUND_LEFT would only be 1 when there was a sound detected on the left, so unless your script runs at exactly the time a sound is detected, the while loop will never be executed and the script will immediately terminate.

Mr.Sukru
Mr.Sukru's picture

Nocturnal said: Its been a while, so I'm not even sure the way your testing the sensor will work, but, unless I am mistaken, RSM_SOUND_LEFT would only be 1 when there was a sound detected on the left, so unless your script runs at exactly the time a sound is detected, the while loop will never be executed and the script will immediately terminate.

i=0

while [ $i -lt 1]

do

if [$(RSM_SOUND_LEFT) = "1"]

then

  execute somethings

fi

if [$(RSM_SOUND_RIGHT) = "1"]

then

  execute somethings

fi

done

 

Is this thrue way or not

Another question how to control fingers of RSM

Thanks.