Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnny-shaman/chirimeneck
Wrapper class on chirimen for raspberry Pi about navigator.requestXAccess
https://github.com/johnny-shaman/chirimeneck
Last synced: 15 days ago
JSON representation
Wrapper class on chirimen for raspberry Pi about navigator.requestXAccess
- Host: GitHub
- URL: https://github.com/johnny-shaman/chirimeneck
- Owner: johnny-shaman
- License: mit
- Created: 2018-10-14T09:59:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-20T08:49:33.000Z (over 6 years ago)
- Last Synced: 2024-11-22T20:37:19.811Z (3 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chirimeneck
Chirimeneck is Chirimen for raspberry Pi functional on navigator.requestXAccess
usage:download this repo and
~~~html
~~~javascript
~~~javascript'use strict';
//GPIO
(async function gpioFunction () {
const gpio5 = await GPIO(5, "in");
const gpio26 = await GPIO(26, "out");
let v = 0;
await gpio5.onchange = function (e) {
v ^= v;
await gpio26.write(v);
};
})();///I2C
(async function i2cFunction() {
try {
var adt7410 = await i2cLoadDriver(ADT7410, 0x48);
while (1) {
var value = await adt7410.read();
// console.log('value:', value);
head.innerHTML = value ? value : head.innerHTML;
await sleep(1000);
}
} catch (error) {
console.error("error", error);
}
}function sleep(ms) {
return new Promise(function(resolve) {
setTimeout(resolve, ms);
});
})();
~~~