lgxa 发表于 2023-5-22 19:57:21

【提问】arduino与迪文DGUS II触摸屏

迪文触摸屏里的数值发送指令给arduino uno板该怎么写,比如我屏幕上的数据变量显示是100,怎么发送指令让arduino uno板识别

integer_32 发表于 2023-5-22 20:50:06

如果是DGUS屏 可以控制板发这个指令读取5A A5 04 83 1000 01读取1000 地址的数据

Mayenvy 发表于 2023-8-15 14:15:02

可以参考下面的代码来解析串口数据,具体数据的判断楼主可以自己写。


static/image/hrline/1.gif
#include <Arduino.h>
#include <MsTimer2.h>


unsigned char tcount = 0;
unsigned char Buffer[80];//建立缓冲区;
unsigned char Buffer_Len = 0;


void Timer2Interrupt()    //定时器函数;
{
if (tcount > 0)
    tcount--;
}

void setup() {
Serial.begin(115200);
MsTimer2::set(5, Timer2Interrupt);//定时器设置,每一步进为5ms;
MsTimer2::start();
}

void loop() {
if (Serial.available())
{
    Buffer = Serial.read();
    Buffer_Len++;
    tcount = 5;
}
}

static/image/hrline/1.gif




页: [1]
查看完整版本: 【提问】arduino与迪文DGUS II触摸屏