Skip to content

Commit

Permalink
WIP make an HTML to make it work on browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-rabault committed Feb 13, 2024
1 parent dcd1025 commit e5854f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
14 changes: 14 additions & 0 deletions examples/projects/browser/led/src/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Luos_engine led example</title>
<script defer src="main.js"></script>
</head>
<body>
<h1 id="pagetitle">
Open the console log (Ctrl + Shift + J or Ctrl + Option + J) to read the
output
</h1>
</body>
</html>
8 changes: 7 additions & 1 deletion examples/projects/browser/led/src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
const program = require('../.pio/build/browser/program');
var isBrowser = new Function(
"try {return this===window;}catch(e){ return false;}"
);
var isNode = new Function("try {return this===global;}catch(e){return false;}");

const program = require("../.pio/build/browser/program");

program
.then(({ Luos_Init, Led_Init, Luos_Loop, Led_Loop, Ws_Init, Ws_Loop }) => {
Luos_Init();
Expand Down

0 comments on commit e5854f3

Please sign in to comment.