Hello friends, I wonder if anyone knows how to increment a value to a variable when presionado Touch Event with Arduino?
For the Touch Event of nextion only increases a value per event!
I'm doing a project of a soldering station with LCD Nextion,
More to increase temperatuara to 350C °, I precisso precionar 350 times to give the value, I do not want that!
/returns the 4-byte hexadecimal data of value 0x71 0x5e 0x01 0x00 0x000xff 0xff 0xff
0x71 0x5e 0x01 0x00 0x000xff 0xff 0xff converter for decimal 0x015e = 350 decimal
0x71 0x5e 0x01 0x00 0x00 0xff 0xff 0xff
This is called little endian byte order. The 4 bytes make up a 32 bit number, the first byte received in the number (0x5E) is the smallest or least significant byte, the final byte of 0x00 is the most significant byte.
1st byte 5E
2nd byte 01
3rd byte 00
4th byte 00
4th x 16777216 + 3rd x 65536 + 2nd x 256 + 1st x 1
0 0 256 94
0x71 return code tells you to expect 4 numeric bytes followed by three 0xFF terminating bytes
Now you know that you need to capture all four bytes, and how to combine them into the one final number = 350
I can make a few suggestions, I don't have code to offer you.
You will have to learn how to arrange your code so that it functions the way you want.
long combining_number = array+array*256+array*65536+array*1677216;
unsigned long combining_number = array+array*256+array*65536+array*1677216;
each byte number from 0 to 255 in the array is combined by multiplying each byte by the value its position holds.
The first error in the code Is that when above 255,
array should not be added to the array value
array is a multiple of 1
array is a multiple of 256.
array is a multiple of 65536.
array is a multiple of 16777216.
b = array*16777216+array*65536+array*256+array;
dispTemvalor = b;