Hi.
I have one Pot controlling the direction of two servos however I need one to turn in the opposite direction to the other when the pot is turned...
I believe it can be done by changing the maths that follows the "analogvalue" or wordcount in the lines below.
readadc analogport1, analogvalue1
analogvalue1 = analogvalue1 *10/17+75
servopos servoport1, analogvalue1
I believe it would have to be set up something like this?
readadc analogport1, analogvalue1
readadc analogport1, analogvalue2
analogvalue1 = analogvalue1 *10/17+75
analogvalue2 = analogvalue2 *(new code here reversing the direction)
servopos servoport1, analogvalue1
servopos servoport2, analogvalue2
I'm stuck as what to write for the little maths line that follows the "analogvalue2 *" section in order to equaly reverse the direction of the servo, for instance if servo1 moves 20 degrees clockwise then servo2 should move 20 degrees anti-clockwise.
Any help would be most apreciated and please let me know if there's anything you want to know.
Many thanks!
I have one Pot controlling the direction of two servos however I need one to turn in the opposite direction to the other when the pot is turned...
I believe it can be done by changing the maths that follows the "analogvalue" or wordcount in the lines below.
readadc analogport1, analogvalue1
analogvalue1 = analogvalue1 *10/17+75
servopos servoport1, analogvalue1
I believe it would have to be set up something like this?
readadc analogport1, analogvalue1
readadc analogport1, analogvalue2
analogvalue1 = analogvalue1 *10/17+75
analogvalue2 = analogvalue2 *(new code here reversing the direction)
servopos servoport1, analogvalue1
servopos servoport2, analogvalue2
I'm stuck as what to write for the little maths line that follows the "analogvalue2 *" section in order to equaly reverse the direction of the servo, for instance if servo1 moves 20 degrees clockwise then servo2 should move 20 degrees anti-clockwise.
Any help would be most apreciated and please let me know if there's anything you want to know.
Many thanks!