new offtime limit

This commit is contained in:
LinoSchmidt
2021-09-30 11:35:41 +02:00
parent 8c12712a2c
commit 48426588d5

View File

@@ -26,6 +26,7 @@
#define loopTime 25
#define PotiFehlerBereich 100
#define AusschaltDelay 80
#define timeToAutoplay 4800 //2min
Servo servoDrehung, servoArm, servoOberarm, servoHand;
@@ -60,7 +61,8 @@ void loop()
if (servoDrehungPos <= servoDrehungPosOLD + PotiFehlerBereich && servoDrehungPos >= servoDrehungPosOLD - PotiFehlerBereich && servoArmPos <= servoArmPosOLD + PotiFehlerBereich && servoArmPos >= servoArmPosOLD - PotiFehlerBereich && servoOberarmPos <= servoOberarmPosOLD + PotiFehlerBereich && servoOberarmPos >= servoOberarmPosOLD - PotiFehlerBereich && servoHandPos <= servoHandPosOLD + PotiFehlerBereich && servoHandPos >= servoHandPosOLD - PotiFehlerBereich)
{
offtime++;
if (timeToAutoplay < offtime)
offtime++;
}
else
{