Home
Features
_Multi DropDown
__DropDown 1
__DropDown 2
__DropDown 3
_ShortCodes
_SiteMap
_Error Page
Mega Menu
Documentation
_Web Documentation
_Video Documentation
Privacy Policy
Daftar Isi
Beranda
ESP 32 Button On-Off
ESP 32 Button On-Off
April 18, 2022
Tombol On-Off. Dapat menggunakan tombol boot di GPIO 0
from machine import Pin tombol=Pin(4, Pin.IN) led=Pin(0, Pin.OUT) from time import sleep hitung=1 flag=True while True: status_tombol = tombol.value() #print(status_tombol) sleep(0.1) if (status_tombol == flag and flag==True): hitung = hitung + 1 print(hitung) flag = False if(hitung==1): led.on() if(hitung==2): led.off() Hitung=0 if(status_tombol==0): flag=True
Social Plugin
ARTIKEL
3/recent/post-list
Facebook
Subscribe Us