mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
UART in Progress
This commit is contained in:
@@ -34,6 +34,59 @@
|
|||||||
"title": "Сканировать",
|
"title": "Сканировать",
|
||||||
"action": "/set?i2c",
|
"action": "/set?i2c",
|
||||||
"class": "btn btn-block btn-default"
|
"class": "btn btn-block btn-default"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "hr"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "h3",
|
||||||
|
"title": "UART"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "checkbox",
|
||||||
|
"name": "uart",
|
||||||
|
"title": "Включить UART",
|
||||||
|
"action": "/set?uart=[[uart]]",
|
||||||
|
"state": "{{uart}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "hr"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "h4",
|
||||||
|
"title": "Скорость",
|
||||||
|
"style": "width:60%;float:left;"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "input",
|
||||||
|
"title": "",
|
||||||
|
"name": "uartS-arg",
|
||||||
|
"state": "{{uartS}}",
|
||||||
|
"style": "width:40%;float:right"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "h4",
|
||||||
|
"title": "Пин TX",
|
||||||
|
"style": "width:60%;float:left;"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "input",
|
||||||
|
"title": "",
|
||||||
|
"name": "uartTX-arg",
|
||||||
|
"state": "{{uartTX}}",
|
||||||
|
"style": "width:40%;float:right"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "h4",
|
||||||
|
"title": "Пин RX",
|
||||||
|
"style": "width:60%;float:left;"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "input",
|
||||||
|
"title": "",
|
||||||
|
"name": "uartTX-arg",
|
||||||
|
"state": "{{uartRX}}",
|
||||||
|
"style": "width:40%;float:right"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ void uartHandle() {
|
|||||||
char inc;
|
char inc;
|
||||||
inc = myUART->read();
|
inc = myUART->read();
|
||||||
incStr += inc;
|
incStr += inc;
|
||||||
if (inc == 0x0A) {
|
if (inc == '\n') {
|
||||||
parse(incStr);
|
parse(incStr);
|
||||||
incStr = "";
|
incStr = "";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user