MCPcopy Create free account
hub / github.com/SiddhantSilwal/RaspberryPi-GPIO-Web-Controller / updateReadout

Function updateReadout

AppData/static/js/graph.js:282–292  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280 }
281
282 function updateReadout() {
283 const x = state.scanPos * state.viewport.xMax;
284 let y = state.fn ? state.fn(x) : 0;
285 const safeV = Math.max(0, Math.min(VOLTAGE_LIMIT, isNaN(y) ? 0 : y));
286 document.getElementById("valX").innerText = x.toFixed(2);
287 document.getElementById("valVolts").innerText = safeV.toFixed(2);
288 document.getElementById("valDuty").innerText = (
289 (safeV / VOLTAGE_LIMIT) *
290 100
291 ).toFixed(1);
292 }
293
294 // Populate GPIO select dropdown for graph control
295 function populateGraphGpioDropdown() {

Callers 1

animateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected