mirror of
https://github.com/kou029w/megabit.git
synced 2025-02-20 07:35:55 +00:00
format
This commit is contained in:
parent
dd87a486ea
commit
976f6a9379
16 changed files with 16 additions and 18 deletions
|
@ -1,6 +1,4 @@
|
||||||
{
|
{
|
||||||
"extends": [
|
"extends": ["config:base"],
|
||||||
"config:base"
|
|
||||||
],
|
|
||||||
"rangeStrategy": "update-lockfile"
|
"rangeStrategy": "update-lockfile"
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ export function ads1015(
|
||||||
async read(): Promise<number> {
|
async read(): Promise<number> {
|
||||||
if (device.i2cSlave == null) await device.init();
|
if (device.i2cSlave == null) await device.init();
|
||||||
return device.read(channel);
|
return device.read(channel);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ export function adt7410(
|
||||||
async read(): Promise<Temperature> {
|
async read(): Promise<Temperature> {
|
||||||
if (device.i2cSlave == null) await device.init();
|
if (device.i2cSlave == null) await device.init();
|
||||||
return device.read();
|
return device.read();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ export function adxl345(
|
||||||
if (device.i2cSlave == null) await device.init();
|
if (device.i2cSlave == null) await device.init();
|
||||||
const acc = await device.read();
|
const acc = await device.read();
|
||||||
return [acc.x, acc.y, acc.z];
|
return [acc.x, acc.y, acc.z];
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ export function gp2y0e03(
|
||||||
async read(): Promise<Distance> {
|
async read(): Promise<Distance> {
|
||||||
if (device.i2cSlave == null) await device.init();
|
if (device.i2cSlave == null) await device.init();
|
||||||
return device.read();
|
return device.read();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import {
|
||||||
GPIOPort,
|
GPIOPort,
|
||||||
OperationError,
|
OperationError,
|
||||||
InvalidAccessError,
|
InvalidAccessError,
|
||||||
requestGPIOAccess
|
requestGPIOAccess,
|
||||||
} from "node-web-gpio";
|
} from "node-web-gpio";
|
||||||
|
|
||||||
export { OperationError, InvalidAccessError, requestGPIOAccess };
|
export { OperationError, InvalidAccessError, requestGPIOAccess };
|
||||||
|
|
|
@ -4,7 +4,7 @@ export {
|
||||||
OperationError,
|
OperationError,
|
||||||
InvalidAccessError,
|
InvalidAccessError,
|
||||||
requestGPIOAccess,
|
requestGPIOAccess,
|
||||||
default as gpio
|
default as gpio,
|
||||||
} from "./gpio";
|
} from "./gpio";
|
||||||
|
|
||||||
export { I2C, I2CSlaveDevice, requestI2CAccess, default as i2c } from "./i2c";
|
export { I2C, I2CSlaveDevice, requestI2CAccess, default as i2c } from "./i2c";
|
||||||
|
|
|
@ -28,7 +28,7 @@ export function mpr121(
|
||||||
async read(): Promise<Touched> {
|
async read(): Promise<Touched> {
|
||||||
if (device.i2cSlave == null) await device.init();
|
if (device.i2cSlave == null) await device.init();
|
||||||
return device.read();
|
return device.read();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ export function paj7620(
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ export function pca9685(
|
||||||
}
|
}
|
||||||
|
|
||||||
await device.setServo(channel, angle);
|
await device.setServo(channel, angle);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ export function s11059(
|
||||||
async read(): Promise<RGB> {
|
async read(): Promise<RGB> {
|
||||||
if (device.i2cSlave == null) await device.init();
|
if (device.i2cSlave == null) await device.init();
|
||||||
return device.readR8G8B8();
|
return device.readR8G8B8();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ export function ssd1306(
|
||||||
device.drawStringQ(index, 0, message);
|
device.drawStringQ(index, 0, message);
|
||||||
});
|
});
|
||||||
await device.playSequence();
|
await device.playSequence();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ export function ssd1308(
|
||||||
device.drawStringQ(index, 0, message);
|
device.drawStringQ(index, 0, message);
|
||||||
});
|
});
|
||||||
await device.playSequence();
|
await device.playSequence();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ export function tsl2561(
|
||||||
async read(): Promise<Illuminance> {
|
async read(): Promise<Illuminance> {
|
||||||
if (device.i2cSlave == null) await device.init();
|
if (device.i2cSlave == null) await device.init();
|
||||||
return device.read();
|
return device.read();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ export function veml6070(bus: I2C = i2c()): ReadableDevice<number> {
|
||||||
if (device.i2cSlaveLSB == null || device.i2cSlaveMSB == null)
|
if (device.i2cSlaveLSB == null || device.i2cSlaveMSB == null)
|
||||||
await device.init();
|
await device.init();
|
||||||
return device.read();
|
return device.read();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ export function vl53l0x(
|
||||||
async read(): Promise<Distance> {
|
async read(): Promise<Distance> {
|
||||||
if (device.i2cSlave == null) await device.init(enableLongRangeMode);
|
if (device.i2cSlave == null) await device.init(enableLongRangeMode);
|
||||||
return device.getRange();
|
return device.getRange();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue