Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Control LED</title>
- <script>
- function controlLED(state) {
- fetch("/led/" + state)
- .then((response) => response.json())
- .then((data) => alert(data.status));
- }
- </script>
- <link
- href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css"
- rel="stylesheet"
- />
- </head>
- <body class="bg-gray-100 flex items-center justify-center h-screen">
- <div class="bg-white p-8 rounded-lg shadow-lg w-80">
- <h1 class="text-3xl font-semibold text-center text-gray-800 mb-6">
- Control LED Over Bluetooth
- </h1>
- <div class="flex justify-center space-x-4">
- <button
- onclick="controlLED('on')"
- class="bg-blue-500 text-white py-2 px-4 rounded-md hover:bg-blue-700 transition duration-300"
- >
- Turn On
- </button>
- <button
- onclick="controlLED('off')"
- class="bg-red-500 text-white py-2 px-4 rounded-md hover:bg-red-700 transition duration-300"
- >
- Turn Off
- </button>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement