Skip to main content

Arduino heartbeat LED library with diagnostic blinking LED for errors

Published: 18 March 2017
Last updated: 15 September 2024

Arduino heartbeat LED class library Arduino heartbeat LED class library

This class combines a heartbeat live indicator with a handy diagnostics tool. You can show errors by its own LED blinking code message. 

Heartbeat showing blinking LED error code 3: 

Library download

Download at GitHub here.

Simpel example

#include "avdweb_HeartBeat.h"

const byte LedPin = 13;
HeartBeat heartBeat(LedPin);

void setup(void) 
{ 
}

void loop(void) 
{ heartBeat.poll(); // first 4sec heartBeat LED
  if(millis()>4000) heartBeat.blinkLED(3); // after 4sec diagnostic blinking LED error code 3
}

 Notes

  • If there are multiple error messages given simultaneously, the lowest number has priority and will be shown by the blinking LED.
  • The value of the LED series resistor depends on the LED efficiency, it should be selected in such a way that the LED goes from minimum to maximum.
  • There are no hardware timers used.
  • You can use all Arduino pins for the LED.

 

 

Other articles from Interfacing with hardware