- Terdapat toggle switch untuk menghidupkan atau mematikan relay secara manual kapan saja, terlepas dari jadwal atau pengaturan mode yang telah diset sebelumnya.
- Jika checkbox diaktifkan (checked), relay akan ON dan jika checkbox dimatikan (unchecked), relay akan OFF.
- Saat toggle switch diaktifkan, relay akan bekerja sesuai durasi air yang diinputkan pada field "Water Duration".
- Contoh: Jika input Water Duration diisi 30 detik, relay akan menyala selama 30 detik, setelah hitungan mundur mencapai 00:00, relay akan mati secara otomatis dan checkbox akan menjadi unchecked.
- Jika Water Duration kosong atau bernilai 0, relay akan tetap menyala tanpa batas waktu (unlimited) sampai relay dimatikan secara manual dengan mematikan toggle (unchecked).
- Toggle switch ini langsung mengirimkan status (ON/OFF) ke perangkat ESP tanpa perlu menekan tombol "SET".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>🧮 Calculator</title> | |
<style> | |
:root { | |
--primary: #ff6b6b; | |
--secondary: #4ecdc4; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import turtle | |
import random | |
# Setup the screen | |
screen = turtle.Screen() | |
screen.bgcolor("white") | |
# Create the turtle | |
t = turtle.Turtle() | |
t.speed(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# URL endpoint | |
url = "https://gradio.hf.space/queue/join?__theme=dark" | |
# Header sesuai dengan yang diberikan | |
headers = { | |
'Accept': '*/*', | |
'Accept-Encoding': 'gzip, deflate, br, zstd', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import os | |
def read_annotations(annotation_path): | |
with open(annotation_path, 'r') as file: | |
lines = file.readlines() | |
annotations = [] | |
for line in lines: | |
parts = line.strip().split() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dependency installation | |
!pip install transformers | |
# Import libraries | |
import torch | |
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer | |
# Function to generate predictions using a model from Hugging Face | |
def predict_sentiment(model, tokenizer, text): | |
inputs = tokenizer(text, return_tensors="pt") |