/*Check various types of horn in servo like double and cross in diagram.json*/
#include <Servo.h>
//change the default value of pos to 180
int pos = 180;
Servo myservo;
void setup() {
// put your setup code here, to run once:
myservo.attach(9);
}
void loop() {
// put your main code here, to run repeatedly:
//Change the condition such that if the position goes negative then pos will reset to 180 units
if(pos <0)
{
pos = 180;
}
delay(100);
//Instead of incrementing the value change the sign to make it decrement by 1unit
pos = pos -1;
myservo.write(pos);
}