I have the following function. I am getting an undefined variable “x” error. How can I tell Python this variable is an unsigned int variable? This variable is only used in this function.
def SmackAbort_Function(channel):
global Abort_Flag;
#Debut Point
print("In Smack Abort Function");
if Abort_Flag:
#Debug Point
print("Abort Flag already set to true returning")
return
else:
#Debug Point
#Debug Point
print("Seting Abort Flag to true");
Abort_Flag = True;
ClickBuzzer()
GPIO.remove_event_detect(Abort_IN_Pin)
GPIO.output( Abort_Out_Pin, True) # Tell logic controler to abort current task
#Wait to make sure the button is release
while x <= 25:
if not (GPIO.input(Abort_In_Pin)):
x = +1;
else:
x = 0;
sleep(0.050);
# Renable push button interrupt so we do not have an interrupt while running the function code
GPIO.add_event_detect(Abort_IN_Pin ,
GPIO.RISING ,
callback = Push_Button_Function,
bouncetime = 100)
#Debut Point
print("Existimg Smack ABORT Function");