import time
import machine
import Pin
tombol = Pin(34, Pin.IN)
from servo import Servo
from time import sleep
hitung =0;
flag = True;
servo_pin = machine.Pin(18)
my_servo = Servo(servo_pin)
my_servo.write_angle(180)
while True:
status_tombol = tombol.value()
print(status_tombol)
sleep(0.1)
if(status_tombol == 1 and flag True):
hitung = hitung + 1
print(hitung)
flag False
if(hitung == 0):
my_servo.write_angle(50)