0

This is the output i get from the serial monitor from using a HM10 in . How could i go about splitting the data using arduino uno. I only want to save the last 12 digits before the :- (4CAA0DE091B7) for it to then be in a format to send as an SMS using a GSM module

OK+Set:1OK+Set:1OK+RESETOK+DISISOK+DISC:00000000:00000000000000000000000000000000:0000000000:4CAA0DE091B7:-062OK+DISC:00000000:00000000000000000000000000000000:0000000000:38F9D379C9E5:-062OK+DISC:00000000:00000000000000000000000000000000:0000000000:446B17218E0C:-073OK+DISC:00000000:00000000000000000000000000000000:0000000000:649BDE9A25C5:-077OK+DISC:00000000:00000000000000000000000000000000:0000000000:DF12A8020D32:-042OK+DISC:00000000:00000000000000000000000000000000:0000000000:4AAC2B4B1C7C:-081OK+DISC:00000000:00000000000000000000000000000000:0000000000:7F4B515BC186:-079OK+DISC:00000000:00000000000000000000000000000000:0000000000:42AB41C03534:-059OK+DISC:00000000:00000000000000000000000000000000:0000000000:7D2A86B2A8CD:-082
OK+DISCEOK+DISISOK+DISC:00000000:00000000000000000000000000000000:0000000000:38F9D379C9E5:-063OK+DISC:00000000:00000000000000000000000000000000:0000000000:42AB41C03534:-063OK+DISC:00000000:00000000000000000000000000000000:0000000000:4CAA0DE091B7:-062OK+DISC:00000000:00000000000000000000000000000000:0000000000:4AAC2B4B1C7C:-073OK+DISC:00000000:00000000000000000000000000000000:0000000000:446B17218E0C:-071OK+DISC:00000000:00000000000000000000000000000000:0000000000:7F4B515BC186:-079OK+DISC:00000000:00000000000000000000000000000000:0000000000:649BDE9A25C5:-089OK+DISC:00000000:00000000000000000000000000000000:0000000000:0CF98919DB7C:-077OK+DISC:00000000:00000000000000000000000000000000:0000000000:DF12A8020D32:-041OK+DISC:00000000:00000000000000000000000000000000:0000000000:56
OK+DISISOK+DISC:00000000:00000000000000000000000000000000:00000OK+DISISOK+DISCEOK+DISC:00000000:00000000000000000000000000000000:0000000000:4AAC2B4B1C7C:-071OK+DISC:00000000:00000000000000000000000000000000:0000000000:38F9D379C9E5:-080OK+DISC:00000000:00000000000000000000000000000000:0000000000:7F4B515BC186:-081OK+DISC:00000000:00000000000000000000000000000000:0000000000:4CAA0DE091B7:-063OK+DISC:00000000:00000000000000000000000000000000:0000000000:0CF98919DB7C:-077OK+DISC:00000000:00000000000000000000000000000000:0000000000:446B17218E0C:-070OK+DISC:00000000:00000000000000000000000000000000:0000000000:649BDE9A25C5:-077OK+DISC:000
OK+DISCEOK+DISISOK+DISC:00000000:00000000000000000000000000000000:0000000000:4AAC2B4B1C7C:-075OK+DISC:00000000:00000000000000000000000000000000:0000000000:4CAA0DE091B7:-076OK+DISC:00000000:00000000000000000000000000000000:0000000000:38F9D379C9E5:-063OK+DISC:00000000:00000000000000000000000000000000:0000000000:649BDE9A25C5:-078OK+DISC:00000000:00000000000000000000000000000000:0000000000:DF12A8020D32:-044OK+DISC:00000000:00000000000000000000000000000000:0000000000:42AB41C03534:-059OK+DISC:00000000:00000000000000000000000000000000:0000000000:446B17218E0C:-071OK+DISC:00000000:00000000000000000000000000000000:0000000000:7D2A86B2A8CD:

1

implement a circular buffer of say 30 characters.

clear the circular buffer

read into the circular buffer, char by char

when the last 13 characters in the buffer are: :4CAA0DE091B7 Then the prior 12 characters are the data of interest

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.