I'm currently working with Raspberry Pi. I have implemented push button(switch) program using python.
But, When I press the switch, then
if condition is
true and data stored but when I release the switch button my program is stuck. Why?
#!/usr/bin/python import RPi.GPIO as GPIO switch_1 = 17 GPIO.setmode(GPIO.BCM) GPIO.setup(switch_1, IN.OUT) while(True): sw1_status = GPIO.input(switch_1) print 'Switch_1 : ', sw1_status if sw1_status == True: print ('Data stored') while(sw1_status != 0): // here my program stuck. pass