Skip to content

Commit

Permalink
changed driver to one that ES moduled
Browse files Browse the repository at this point in the history
create Node.js version example
  • Loading branch information
rasp753 committed Jan 30, 2020
1 parent 1348971 commit 84e70da
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 716 deletions.
5 changes: 2 additions & 3 deletions examples/adxl345/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
content="width=device-width, user-scalable=no, initial-scale=1"
/>
<title>Grove Digital Accelerometer sensor</title>
<script src="node_modules/@chirimen-raspi/polyfill/polyfill.js"></script>
<script src="node_modules/@chirimen-raspi/chirimen-driver-i2c-grove-accelerometer/GROVEACCELEROMETER.js"></script>
<script src="./main.js" defer></script>
<script src="https://r.chirimen.org/polyfill.js"></script>
<script src="./main.js" type="module"></script>
<style>
p {
color: blue;
Expand Down
4 changes: 3 additions & 1 deletion examples/adxl345/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import GROVEACCELEROMETER from "https://unpkg.com/@chirimen/grove-accelerometer?module";

main();

async function main() {
Expand All @@ -15,7 +17,7 @@ async function main() {
ay.innerHTML = values.y ? values.y : ay.innerHTML;
az.innerHTML = values.z ? values.z : az.innerHTML;
} catch (err) {
console.log("READ ERROR:" + err);
console.error("READ ERROR:" + err);
}
await sleep(1000);
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 84e70da

Please sign in to comment.