🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@dtex/mock-io

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dtex/mock-io - npm Package Compare versions

Comparing version

to
0.0.3

modules/analog.js

4

index.js
import Digital from "./modules/digital.js";
import PWM from "./modules/pwm.js";
import I2C from "./modules/i2c.js";
import Analog from "./modules/analog.js";
export { Digital, PWM }
export { Digital, PWM, I2C, Analog }
class Digital {
static Input = 0x00;
static Output = 0x01;

@@ -8,14 +9,26 @@

this.edge = (undefined === opts.edge) ? 0 : opts.edge;
this.mode = opts.mode;
this.mode = opts.mode || 0x00;
this.onReadable = opts.onReadable;
this.target = opts.target;
this.value = 0x00;
this.Input = 0x00;
this.Output = 0x01;
}
read() {
return this.value;
}
write(value) {
}
if (value != this.value) {
this.value = value;
if (this.mode === this.Input) {
this.onReadable();
}
}
}
exTrigger(event) {
this.emit(event);
}

@@ -22,0 +35,0 @@ }

@@ -6,9 +6,12 @@ class PWM {

constructor(opts) {
this.pin = opts.pin;
this.edge = (undefined === opts.edge) ? 0 : opts.edge;
this.mode = opts.mode;
this.onReadable = opts.onReadable;
this.target = opts.target;
this.resolution = 10;
this.value = null;
return (async () => {
console.log(opts.pin);
this.pin = opts.pin;
this.edge = (undefined === opts.edge) ? 0 : opts.edge;
this.mode = opts.mode;
this.onReadable = opts.onReadable;
this.target = opts.target;
this.resolution = 10;
this.value = null;
})();
}

@@ -15,0 +18,0 @@

{
"name": "@dtex/mock-io",
"version": "0.0.2",
"version": "0.0.3",
"description": "Mock file for TC-53 IO testing",

@@ -5,0 +5,0 @@ "main": "index.js",