Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1585

Python • +/- Value

$
0
0
Hi, I'm trying to add add a +/-1 dead band to a value so the output doesn't chatter with noise. Any help would be greatly appreciated. Thanks

potvalue == (+/-1)+15:


current working code

Code:

#15 Deg        if select15.value() == 0 and potvalue == 15:        relayPin1.value(0)        relayPin2.value(0)        if select15.value() == 0 and potvalue > 15:        relayPin2.value(0)        relayPin1.value(1)        print ("raise")        if select15.value() == 0 and potvalue < 15:        relayPin1.value(0)        relayPin2.value(1)        print ("lower")

Statistics: Posted by PNEFC — Wed Aug 28, 2024 8:02 am



Viewing all articles
Browse latest Browse all 1585

Trending Articles