1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <title>MCTX3420 Web Interface</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 <script type="text/javascript" src="static/jquery-1.10.1.min.js"></script>
7 <script type="text/javascript" src="static/mctx.gui.js"></script>
8 <script type="text/javascript" src="static/mctx.pintest.js"></script>
10 <link rel="stylesheet" type="text/css" href="static/style.css">
11 <link rel="stylesheet" type="text/css" href="static/nav-menu.css">
12 <script type="text/javascript">
13 runBeforeLoad().done(function () {
14 //Ensure stuff is unloaded before leaving the page
15 $(window).unload(function(){
16 $("#adc-controls").find("input[type='checkbox']")
18 if ($(this).is(":checked")) {
19 $(this).trigger("click");
22 $("#gpio-container").find("input[name='unexport']")
24 $(this).trigger("click");
26 $("#pwm-container").find("input[name='unexport']")
28 $(this).trigger("click");
32 $(document).ready(function () {
34 var name = " " + (mctx.friendlyName ? mctx.friendlyName : "");
35 $("#welcome-container").text("Welcome"+ name + "!");
36 $("#content").css("display", "block");
38 $("#logout").click(function () {
39 $("#logout").logout();
42 $("#gpio-menu").populateDropdown(mctx.pintest.gpios, "GPIO ");
43 $("#pwm-menu").populateDropdown(mctx.pintest.pwms, "PWM ");
45 $("#gpio-go").click(function () {
46 if ($("#gpio-menu").val()) {
47 $(this).attr("disabled", true);
48 $("#gpio-container").exportGPIO($("#gpio-menu")).always(function () {
49 $("#gpio-go").attr("disabled", false);
53 $("#pwm-go").click(function () {
54 if ($("#pwm-menu").val()) {
55 $(this).attr("disabled", true);
56 $("#pwm-container").exportPWM($("#pwm-menu")).always(function () {
57 $("#pwm-go").attr("disabled", false);
61 $("#adc-controls").trigger("reset").setADCControl();
63 $("#errorlog").setErrorLog();
71 <div id="header-wrap">
74 <a href="http://www.uwa.edu.au/" target="_blank">
75 <img alt = "The University of Western Australia"
76 src="static/uwacrest-text.png">
78 <span id="title">BBB Pin test (debug only)</span>
81 <span id="welcome-container">
84 <script type="text/javascript">getDate();</script>
86 <div id="logout-container">
89 <input type="button" id="logout" value="Logout">
94 <div class="clear"></div>
99 <div id="content-wrap">
101 <div class="widget centre">
102 <div class="title">JavaScript required</div>
103 This website requires JavaScript to function correctly.
104 Please enable JavaScript to use this site.
111 <div class="title">Navigation menu</div>
112 <div class="nav-menu">
114 <li><a href="index.html"><span>Home</span></a></li>
115 <li><a href="control.html"><span>Experiment control</span></a></li>
116 <li><a href="pintest.html"><span>Pin debugging</span></a></li>
117 <li class="last"><a href="#"><span>Help</span></a></li>
122 <div class="title">Info</div>
123 <p>This test page gives control over the BBB's pins.
124 Select a pin that you wish to use from the relevant drop-down
125 menu and click 'Go'.</p>
126 <p>A new widget will appear with controls relevant to that pin.</p>
127 <p>Make sure to check the error log to see if something goes wrong.</p>
130 <div class="title">Pin out diagram</div>
131 <p>To see the pin out diagram of the BBB, click <a href="pinout-table.pdf" target="_blank">here</a>.</p>
134 <div class="title">Export/Unexport?</div>
136 To export/unexport a pin means to enable/disable it. Apart from the obvious
137 use case, sometimes this can be required if you use two PWM channels
138 that share the same frequency base.
141 You won't be able to change
142 the frequency until you unexport one of them.
146 <div class="title">PWM explained</div>
147 <p>The frequency must be a decimal number greater than 0.</p>
149 The duty cycle describes the proportion of off/on time per period.
150 This number is specified as a ratio, with values ranging from 0 to 1.
153 The polarity determines if the duty represents the 'active
154 high' or 'active low' portion. By default, the duty cycle
155 represents the 'active high' portion.
163 <div class="title">Dashboard</div>
167 GPIO <select id="gpio-menu"></select>
168 <input type="button" id="gpio-go" value="Go">
171 PWM <select id="pwm-menu"></select>
172 <input type="button" id="pwm-go" value="Go">
177 <div class="sub-title">Error log</div>
178 <textarea id="errorlog" wrap="off" rows="4" cols="30" readonly></textarea>
182 <div class="title">Analogue input (ADC)</div>
183 <form class="controls" action="#" id="adc-controls">
184 <table class="centre">
186 <td>AIN</td><th>0</th><th>1</th><th>2</th><th>3</th>
187 <th>4</th><th>5</th><th>6</th><th>7</th>
191 <td><input name="0" type="text" readonly></td>
192 <td><input name="1" type="text" readonly></td>
193 <td><input name="2" type="text" readonly></td>
194 <td><input name="3" type="text" readonly></td>
195 <td><input name="4" type="text" readonly></td>
196 <td><input name="5" type="text" readonly></td>
197 <td><input name="6" type="text" readonly></td>
198 <td><input name="7" type="text" readonly></td>
202 <td><input name="0" type="checkbox"></td>
203 <td><input name="1" type="checkbox"></td>
204 <td><input name="2" type="checkbox"></td>
205 <td><input name="3" type="checkbox"></td>
206 <td><input name="4" type="checkbox"></td>
207 <td><input name="5" type="checkbox"></td>
208 <td><input name="6" type="checkbox"></td>
209 <td><input name="7" type="checkbox"></td>
215 <div class="widget" id="gpio-container">
216 <div class="title">GPIO controls</div>
219 <div class="widget" id="pwm-container">
220 <div class="title">PWM controls</div>
223 <!-- End main content -->