2018-09-10

Die Webseite zum Esp32 BH1750.

bh1750.html

<!-- For more information visit: https://fipsok.de -->
<!DOCTYPE HTML>
<html lang="de">
   <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link rel="stylesheet" href="style32.css">
      <title>BH1750 Beleuchtungsstärke</title>
      <script>
         function renew() {
           fetch('/bh1750').then(function (response) {
             return response.json();
           }).then(function (text) {
             document.querySelector('#wert').innerHTML = text + ' lx';
           });
         }
         document.addEventListener('DOMContentLoaded', renew);
         setInterval(renew, 1000);
      </script>
      <style>
         body {
         padding: 10px;
         font-size: 3em;
         }
         section {
         align-items: center;
         background-color: black;
         width: 280px;
         height: 100px;
         border: .15em solid #aeaeab;
         box-shadow: 5px 10px 5px rgba(0, 0, 0, 0.7);
         border-radius: .2em;
         }
         span {
         color: #02fc07;
         position: relative;
         top: 0.5em;
         left: .3em;
         letter-spacing: .1em;
         font-weight: bold
         }
      </style>
   </head>
   <body>
      <section>
         <span id='wert'></span>
      </section>
   </body>
</html>

Zurück