MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / scan

Method scan

contributed/charlieplexer/main.js:10–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8 }
9
10 scan() {
11 for (let i = 0; i < this.pins.length - 1; i++) {
12 for (let j = i + 1; j < this.pins.length; j++) {
13 const p1 = this.pins[i];
14 const p2 = this.pins[j];
15 p1.mode(Digital.Output);
16 p2.mode(Digital.Output);
17
18 p1.write(1);
19 p2.write(0);
20 Timer.delay(100);
21
22 p1.write(0);
23 p2.write(1);
24 Timer.delay(100);
25
26 p1.mode(Digital.Input);
27 p2.mode(Digital.Input);
28 }
29 }
30 }
31}

Callers 2

wifiScanFunction · 0.45
apScanMethod · 0.45

Calls 3

delayMethod · 0.80
writeMethod · 0.65
modeMethod · 0.45

Tested by

no test coverage detected