I have a sonic wind sensor that i am getting data from using an RS485 connection. parse the received message either use &message or use data variable data points to the 3rd element of the received message Below code also removes the BB at the end char message = "BBVV.V DDD SSS.S CCBB" Once you have an array, you can simply point to the 3rd element to skip the starting BB. Although the examples in Serial Input Basics might not fully apply because BB also seems to be the end of the message, it will give you an idea how to save to an array. If it's indeed a single byte, you first want to collect a complete message before you apply strtok(). May we assume that getdata is just a byte? Not posting full code makes it difficult to judge. What is the 'startbit' that you are referring to? BB? Slightly strange that BB is also the end of the message, but OK.
0 Comments
Leave a Reply. |