control amplitude threshold via UI
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
<div class="panels">
|
<div class="panels">
|
||||||
<div>
|
<div>
|
||||||
Bit Duration: <input id="bit-duration-text" type="number" min="0" max="1000" value="180">ms<br>
|
Bit Duration: <input id="bit-duration-text" type="number" min="0" max="1000" value="180">ms<br>
|
||||||
|
Amplitude Threshold: <input id="amplitude-threshold-text" type="number" min="0" max="255" value="200"><br>
|
||||||
<input type="text" id="text-to-send">
|
<input type="text" id="text-to-send">
|
||||||
<button id="send-button">Send</button>
|
<button id="send-button">Send</button>
|
||||||
<h2>Sent</h2>
|
<h2>Sent</h2>
|
||||||
|
|||||||
6
index.js
6
index.js
@@ -38,7 +38,11 @@ function handleWindowLoad() {
|
|||||||
FREQUENCY_DURATION = parseInt(event.target.value);
|
FREQUENCY_DURATION = parseInt(event.target.value);
|
||||||
bitSampleCount = 0;
|
bitSampleCount = 0;
|
||||||
samplesPerBit.length = 0;
|
samplesPerBit.length = 0;
|
||||||
})
|
});
|
||||||
|
document.getElementById('amplitude-threshold-text').addEventListener('input', (event) => {
|
||||||
|
FREQUENCY_THRESHOLD = parseInt(event.target.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// wire up events
|
// wire up events
|
||||||
sendButton.addEventListener('click', handleSendButtonClick);
|
sendButton.addEventListener('click', handleSendButtonClick);
|
||||||
|
|||||||
Reference in New Issue
Block a user