forked from GoogleChrome/chrome-extensions-samples
/
main.html
55 lines (47 loc) · 1.73 KB
/
main.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<script src="logic.js"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="container">
<label>
Port:
<select id="port-picker"></select>
</label>
<label>
Status:
<span id="status">Loading</span>
</label>
</div>
<div id="inputs">
<label>
DCD:
<span id="dcd_status">---</span>
</label>
<label>
CTS:
<span id="cts_status">---</span>
</label>
<div id="outputs">
<label>
DTR:
<input type="checkbox" id="dtr_input"></input>
</label>
<label>
RTS:
<input type="checkbox" id="rts_input"></input>
</label>
</div>
<h3>How to use</h3>
<ol>
<li>Identify a serial port on your machine. These days you might need to plug in a USB-to-serial adapter.</li>
<li>Connect four wires to DCD (pin 1), DTR (pin 4), RTS (pin 7), and CTS (pin 8). Write down which is which.</li>
<li>Fire up this app.</li>
<li>Make sure that the port dropdown matches your serial port.</li>
<li>Using a multimeter, confirm that the two outputs (DTR and RTS) swing from negative voltage (true, or checked checkbox) to positive voltage (false, or unchecked checkbox) in sync with the two checkboxes in the app.</li>
<li>Provide a reference voltage to each of the two inputs (DCD and CTS) and confirm that the app's true/false indicators properly update themselves. If you want a quickie reference voltage, just connect one of the outputs to one of the inputs (e.g., DTR to DCD) and flick the output on and off. Note that the input-reading code is on a 1-second timer, so there's often a bit of latency.</li>
</ol>
</body>
</html>