Hey guys i-am working on a little project but i got a little problem,
The servo goes the opposite direction of that i want it to go.
So when i turn the servo to 180 in code i want it to go to 0 i rl,
Also if i turn it to 0 in code i want it to turn to 180 in rl.
With ofcourse all the steps inbetween.
It must be such a simple thing but i just can't wrap my head around it at this moment.
here's a little nibble of my code:
if(v <= 50) /* this limits steering, if v is less than 50 just write 50 */
{
steering.write(50);
}
else if(v >= 130) /* and also for the other side, if v is more than 130 just write 130 */
{
steering.write(130);
}
else{
steering.write(v); /* if that's both not the case just write v */
v = 0;
break;
}
end of the code nibble. (in this example it would be 50 to 130 instead of 0 to 180).
Who knows the answer? please tell meh.