@ -1,5 +1,9 @@
|
||||
import GPIO from "rpi-gpio";
|
||||
import Container from "./database/Container";
|
||||
import debug from "debug";
|
||||
const log = debug("itender:gpio");
|
||||
|
||||
// Package is raspi-gpio in raspberrypi
|
||||
|
||||
export class MyGPIO {
|
||||
static setup(pin: number, direction): Promise<void> {
|
||||
@ -35,6 +39,7 @@ export class MyGPIO {
|
||||
}
|
||||
|
||||
static setupPins(): Promise<void> {
|
||||
log("Setting up GPIO-Pins...");
|
||||
return new Promise(async resolve => {
|
||||
let containers = await Container.find({});
|
||||
for (let c of containers) {
|
||||
|
@ -40,6 +40,7 @@ const wsApp = new WebsocketApp();
|
||||
|
||||
log("Check OK, starting...");
|
||||
await init();
|
||||
log("Init OK");
|
||||
setInterval(refresh, 1000 * 60);
|
||||
iTender.setStatus(iTenderStatus.READY);
|
||||
|
||||
|
Reference in New Issue
Block a user