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