ok. so the only things you can send over serial are raw bytes. this means that you need to convert whatever you want to send to bytes first. the tricky thing is to understand if the receiving end expects to interpret the bytes it receives as a string (or char), like “1” or as an actual integer number, like 1.
it seems your arduino code expects the integer in the form of a string, like “1”. so in that case what your doing:
- first convert the int to a string using AsString
- then convert the string to raw bytes using AsRaw
is the correct thing to do. you’re sending a byte of value 31 which represents a string of “1”. arduino will receive that byte and when again interpreted as string it will see a “1”.
so this part doesn’t seem to be the problem.
what i understand much less is the part above the Sift. what is this exactly supposed to do. can you describe that in words?