Hello there
My name is Aman and I am new to scripts. Here is my problem. I have Pololu servo controller (18Ch). I am trying to sense colors of an object using LED as sensor. Channel 0-3 of servo controller has four different color LEDs attached. I can see sensing of all four LED in maestro controller ranging from 0-100. Now I want to use some math in it like ratio of value of
ch-3/ch-0
ch-3/ch-1
ch-3/ch-2
in if statements to trigger relay using channel 5. I will really appreciate if anyone rectify my script make it working one. Thanks in advance.
Aman
begin
0 get_position
1 get_position
2 get_position
3 get_position
a EQUALS 3 get_position DIVIDE 0 get_position
b EQUALS 3 get_position DIVIDE 1 get_position
b EQUALS 3 get_position DIVIDE 2 get_position
dup a EQUALS 3 more than LOGICAL_AND b EQUALS 4 more than
if
8000
else
5000
endif
5 servo
repeat