Hi there,
Can somebody help with DWIN Display.. It is very new for me..
I want to change a boolean value state from 0 to 1 by just touching Dwin display. As I have created a GUI which has two buttons(Test_Fun and Run_Fun) and now I'm not able to figure our that which action should I perform on buttons so that when I touch that buttons on dwin display then It will change the boolean variable state then I'll use that variable for further steps.
//for interfacing dwin display
unsigned char test_run[9];
unsigned char Buffer[9];
#define test_fun 0x10 // VP in DGUS Software
#define run_fun 0x11 // VP in DGUS Software
bool test_run_bool = 0;
const int leftEnable = 15; //driver2(left) [Paper movement forward-->motor ccw]
const int rightEnable = 23; //driver1(right) [Paper movement backward-->motor cw]
const int pinchEnable = 5; //driver3(pinch roller) [repeatative movement of paper forard backward by 50 mm]
void setup(){
// Set the step and direction pins as outputs
Serial.begin(9600);
Serial2.begin(9600);
Serial.println("Serial began at 9600..!");
pinMode(rightEnable, OUTPUT); //driver 2
pinMode(leftEnable, OUTPUT);//driver 1
pinMode(pinchEnable, OUTPUT);
digitalWrite(leftEnable, LOW);
digitalWrite(rightEnable, LOW);
digitalWrite(pinchEnable, LOW);
Serial.println("system powered ON");
}
void loop(){
if(Serial2.available())
{
for(int i = 0; i <= 8; i++)
{
Buffer[i] = Serial2.read();
Serial2.println(Buffer[i]);
//Serial.print(Buffer[i]);
}
if(Buffer[0] == 0x5A)
{
switch (Buffer[4])
{
case 0x10:
test_run_bool = 1;
Serial.println("Test Function clicked..!");
break;
case 0x11:
Serial.println("Run Function clicked..!");
break;
default:
Serial2.println("Default case");
break;
}
}
}
if(test_run_bool == 1){
digitalWrite(leftEnable, HIGH);
digitalWrite(rightEnable, HIGH);
digitalWrite(pinchEnable, HIGH);
}
Serial.print("test_run_bool value : ");
Serial.println(test_run_bool);
}
can anybody pls tell me what I'm missing because when running this program I'm getting Invalid header error..
12:52:56.134 -> rst:0x10 (RTCWDT_RTC_RESET),boot:0x37 (SPI_FAST_FLASH_BOOT)
12:52:56.179 -> invalid header: 0xffffffff
12:52:56.211 -> invalid header: 0xffffffff
12:52:56.258 -> invalid header: 0xffffffff
12:52:56.303 -> invalid header: 0xffffffff
12:52:56.350 -> invalid header: 0xffffffff
12:52:56.397 -> invalid header: 0xffffffff
12:52:56.442 -> invalid header: 0xffffffff