Wiblocks --- LED_debug Class

LED_debug Class

Controls the debug LED that is on various wiblocks boards. The contains a constructor and a single function -- blink. Calling blink with a value of zero not only flashes the LED forever program but hangs your program ;)


#include <LED_debug.h>
LED_debug led(7);

void loop() {
   led.blink(3); // blink three times
   led.blink(0); // blink forever
}

LED_debug Class Reference

Public Member Functions

 LED_debug (unsigned char pin=7)
void blink (unsigned char num_times)

Static Public Attributes

static const unsigned char _on_delay = 75
static const unsigned char _off_delay = 75

Detailed Description

Definition at line 9 of file LED_debug.h.

Constructor & Destructor Documentation

LED_debug::LED_debug ( unsigned char  pin = 7  ) 

Constructs and LED_debug object and initializes the the output pin.

Parameters:
[in] pin Pin number that the LED is connected to. This is the Arduino pin number (0..13).
Todo:
Add initialization for the _on_delay and and _off_delay

Definition at line 18 of file LED_debug.cpp.

Member Function Documentation

void LED_debug::blink ( unsigned char  num_times  ) 

Blinks the debug LED. The LED is on for _on_delay number of milliseconds and then off for _off_delay number of milliseconds.

Parameters:
[in] num_times number of times to blink the LED. If number of times is zero than the LED blinks continously.

Definition at line 33 of file LED_debug.cpp.

The documentation for this class was generated from the following files: