Functional Testing Program

Has anyone written a generic test program for the Blinks? I image it using seven blinks: six in a ring - known good ones ideally, and one in the center that you’re testing. They ping each other and indicate communication is good or not. I’m thinking about writing this program if it does not exist. I think I have two blinks with one dead IR face each, and I’ve already sent back one. Let me know your thoughts. It might be easy enough to whip up. If I do, I’ll post it here. Thanks in advance.

1 Like

This is most likely the simplest thing you can do.

#include <blinklib.h>

void setup() {}

void loop() {
  FOREACH_FACE(face) {
    if (isValueReceivedOnFaceExpired(face)) {
      setColorOnFace(OFF, face);
    } else {
      setColorOnFace(GREEN, face);
    }
  }
}
2 Likes

BTW, note you can even upload it to a single Blink and use it to test another blink running any game. It does not try to catch cases where there is a connection but data being transferred is garbage.

1 Like

I’ll try this later tonight and report back in. Thanks a million for the idea!

At first, it confirmed a dead face, but then after reteaching the blank blink a few times, the issue went away. So I wrote this overly-complex tester, and this works, too. I guess I’ll just keep this code handy and continue as though everything is working fine.

#include <blinklib.h>

static const byte msg = 25;
byte faceToTest;
bool isCenter = false;

void setup() {
  faceToTest = 0;
}

void loop() {
  setColor(OFF);

  if (buttonSingleClicked()) {
    faceToTest = (++faceToTest) % 6;
  }

  if (buttonDoubleClicked()) {
    isCenter = !isCenter;
  }

  if (!isCenter) {
    for (byte i = 0; i <= faceToTest; i++) {
      setColorOnFace(BLUE, i);
      setValueSentOnFace(faceToTest, i);
    }
  } else {
    FOREACH_FACE(face) {
      if (isValueReceivedOnFaceExpired(face)) {
        setColorOnFace(RED, face);
      } else {
        if (getLastValueReceivedOnFace(face) == face) {
          setColorOnFace(GREEN, face);
        } else {
          setColorOnFace(YELLOW, face);
        }
      }
    }
  }
}

Try replacing the battery on the blink that seems to have an issue and check if it helps.

1 Like

There are programs in Examples:
IRButtonPressTester and IRLinktester.

2 Likes