# LED
[Core]

Controls the single green LED on the MAKE Controller Board. More...

## Functions
int | Led_SetActive (int state)
| Sets whether the Led subsystem is active.
int | Led_GetActive ()
| Read the active state of the LED system.
int | Led_SetState (int state)
| Control the LED on the MAKE Controller Board.
int | Led_GetState ()
| Read the state of the LED on the MAKE Controller Board.

## Detailed Description

Controls the single green LED on the MAKE Controller Board.

There are two LEDs on the MAKE Controller Board - one green and one red. The red LED is simply a power indicator and cannot be controlled by the Controller. The green LED can be used for program feedback. In many MakingThings applications, for example, it is set to blink once a second, showing the board's "heartbeat" and letting the user know that the board is running.

## Function Documentation

int Led_GetActive | ( | void |  | ) |

Read the active state of the LED system.

Returns:
  State - 1/non-zero (on) or 0 (off).

Example

      int enabled = Led_GetActive();
      if(enabled)
      {
        // then we're enabled
      }
      else
      {
        // not enabled
      }

Definition at line 86 of file led.c.

int Led_GetState | ( | void |  | ) |

Read the state of the LED on the MAKE Controller Board.

Returns:
  State - 1/non-zero (on) or 0 (off).

Example

      int led_on = Led_GetState();
      if(led_on)
      {
        // the LED is on
      }
      else
      {
        // the LED is off
      }

Definition at line 131 of file led.c.

int Led_SetActive | ( | int | state | ) |

Sets whether the Led subsystem is active.

Parameters:

  | state | An integer specifying the active state of the LED system - 1 (on) or 0 (off).

Returns:
  Zero on success.

Example

      // enable the LED system
      Led_SetActive(1);

Definition at line 61 of file led.c.

int Led_SetState | ( | int | state | ) |

Control the LED on the MAKE Controller Board.

Parameters:

  | state | An integer specifying the state - on (1) or off (0).

Returns:
  0 on success.

Example

      // turn the LED on
      Led_SetState(1);

Definition at line 102 of file led.c.