Advertisement
NaroxEG

Flask LED INO Control HC05 HTML

Jan 25th, 2025
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.49 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.     <head>
  4.         <meta charset="UTF-8" />
  5.         <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6.         <title>Control LED</title>
  7.         <script>
  8.             function controlLED(state) {
  9.                 fetch("/led/" + state)
  10.                     .then((response) => response.json())
  11.                     .then((data) => alert(data.status));
  12.             }
  13.         </script>
  14.         <link
  15.            href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css"
  16.            rel="stylesheet"
  17.        />
  18.     </head>
  19.     <body class="bg-gray-100 flex items-center justify-center h-screen">
  20.         <div class="bg-white p-8 rounded-lg shadow-lg w-80">
  21.             <h1 class="text-3xl font-semibold text-center text-gray-800 mb-6">
  22.                 Control LED Over Bluetooth
  23.             </h1>
  24.             <div class="flex justify-center space-x-4">
  25.                 <button
  26.                    onclick="controlLED('on')"
  27.                    class="bg-blue-500 text-white py-2 px-4 rounded-md hover:bg-blue-700 transition duration-300"
  28.                >
  29.                     Turn On
  30.                 </button>
  31.                 <button
  32.                    onclick="controlLED('off')"
  33.                    class="bg-red-500 text-white py-2 px-4 rounded-md hover:bg-red-700 transition duration-300"
  34.                >
  35.                     Turn Off
  36.                 </button>
  37.             </div>
  38.         </div>
  39.     </body>
  40. </html>
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement