Go Down

Topic: Program Compiles but doesn't run at 100% (Read 1 time) previous topic - next topic


hmmm.... something like this?
Code: [Select]
char mensagem[6];
  byte buf[VW_MAX_MESSAGE_LEN];
  byte buflen = VW_MAX_MESSAGE_LEN;

if (sizeof(buflen) > 5) { Serial.print(F("BUFFER OVERFLOW"));}

  if (vw_get_message(buf, &buflen)) {
    digitalWrite(ledRececao, HIGH);


Something like that, but you surely do not want to fall through into the rest of the code and make the overflow error happen, so put the stuff below on an else clause.


Edit: hold the phone:
Code: [Select]

if (sizeof(buflen) > 5)

Didn't you mean if (buflen > 5)?



Sorry  :smiley-red: my mistake.  Yes the ELSE func. is for everything less that 6 bytes will go to the if statement of vw_get_message.

If, for some reason i have to go to an arduino mega this code will be just upload to it or do i have to make some changes?


If you move to the mega you may need to reassign some pins to avoid mega hardware conflicts, but otherwise the code should move over without changes.



Thanks a lot!  I'll test what you told me to do and see what happens. I'll post feedback.
Thanks to all for your attention!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131