Serial-Studio/examples/HexadecimalADC/HexadecimalADC.json
2024-10-27 05:38:58 -05:00

123 lines
4.3 KiB
JSON

{
"actions": [
],
"decoder": 1,
"frameEnd": ";",
"frameParser": "/**\n * This function parses a binary data frame (represented as a hexadecimal string),\n * and converts it into an array of decimal values (0-255).\n *\n * @param[in] frame The latest received frame as a hexadecimal string.\n * @return Array of integers containing the parsed frame elements.\n */\nfunction parse(frame, separator) {\n let dataArray = [];\n for (let i = 0; i < frame.length; i += 2) {\n let hexByte = frame.substring(i, i + 2);\n let decimalValue = parseInt(hexByte, 16);\n dataArray.push(decimalValue * 5.0 / 255);\n }\n\n return dataArray;\n}",
"frameStart": "$",
"groups": [
{
"datasets": [
{
"alarm": 0,
"fft": true,
"fftSamples": 1024,
"fftSamplingRate": 250,
"graph": false,
"index": 1,
"led": false,
"ledHigh": 1,
"log": false,
"max": 5,
"min": 0,
"title": "ADC 0",
"units": "Volts",
"value": "--.--",
"widget": ""
},
{
"alarm": 0,
"fft": true,
"fftSamples": 1024,
"fftSamplingRate": 250,
"graph": false,
"index": 2,
"led": false,
"ledHigh": 1,
"log": false,
"max": 5,
"min": 0,
"title": "ADC 1",
"units": "Volts",
"value": "--.--",
"widget": ""
},
{
"alarm": 0,
"fft": true,
"fftSamples": 1024,
"fftSamplingRate": 250,
"graph": false,
"index": 3,
"led": false,
"ledHigh": 1,
"log": false,
"max": 5,
"min": 0,
"title": "ADC 2",
"units": "Volts",
"value": "--.--",
"widget": ""
},
{
"alarm": 0,
"fft": true,
"fftSamples": 1024,
"fftSamplingRate": 250,
"graph": false,
"index": 4,
"led": false,
"ledHigh": 1,
"log": false,
"max": 5,
"min": 0,
"title": "ADC 3",
"units": "Volts",
"value": "--.--",
"widget": ""
},
{
"alarm": 0,
"fft": true,
"fftSamples": 1024,
"fftSamplingRate": 250,
"graph": false,
"index": 5,
"led": false,
"ledHigh": 1,
"log": false,
"max": 5,
"min": 0,
"title": "ADC 4",
"units": "Volts",
"value": "--.--",
"widget": ""
},
{
"alarm": 0,
"fft": true,
"fftSamples": 1024,
"fftSamplingRate": 250,
"graph": false,
"index": 6,
"led": false,
"ledHigh": 1,
"log": false,
"max": 5,
"min": 0,
"title": "ADC 5",
"units": "Volts",
"value": "--.--",
"widget": ""
}
],
"title": "ADC Readings",
"widget": "multiplot"
}
],
"mapTilerApiKey": "",
"separator": ",",
"thunderforestApiKey": "",
"title": "Hexadecimal ADC"
}