# Grove LED Socket Kit

![](https://github.com/SeeedDocument/Grove-LED_Socket_Kit/raw/master/img/Grove-White-LED-p-2016.jpeg)

Grove - LED is designed for the beginners of Arduino/Seeeduino to monitor controls from digital ports. It can be mounted to the surface of your box or desk easily and used as pilot lamp for power or signal. Its brightness can be adjust by potentiometer.

## Features

* Grove compatible interface
* 3.3V/5V Compatible
* Adjustable LED orientation
* Adjustable LED brightness

## Specification

| \*\*Item\*\*     | \*\*Description\*\*    |
| ---------------- | ---------------------- |
| LED Control Mode | Digital Pin of Arduino |
| Working Voltage  | 5V                     |
| Supply Mode      | Grove Interface        |

## Get Started with Aduino

Here we show how to use Arduino to control the state of the LED.

1.Connect the LED to Base Shield's **digital port 2** with 4pin Grove Cable.Of course you can change to other valid digital ports if it's necessary and the definitions of the port should be changed too.

2.Plug it onto the Arduino/Seeeduino. Connect the board to PC using USB cable.

![](https://github.com/SeeedDocument/Grove-LED_Socket_Kit/raw/master/img/Grove-LED.jpg)

3.Copy the demo code to your sketch, then upload to Arduino or Seeeduino board. Please click [here](http://www.seeedstudio.com/wiki/Upload_Code) if you do not know how to upload.

You will see the LED blink every second.

```
/*************************************************************************
* File Name          : GroveLEDDemoCode.ino
* Author             : Seeedteam
* Version            : V1.1
* Date               : 18/2/2012
* Description        : Demo code for Grove - LED
*************************************************************************/

#define LED 2 //connect LED to digital pin2
void setup() {
    // initialize the digital pin2 as an output.
    pinMode(LED, OUTPUT);
}

void loop() {
    digitalWrite(LED, HIGH);   // set the LED on
    delay(500);               // for 500ms
    digitalWrite(LED, LOW);   // set the LED off
    delay(500);
}
```

## Get Started with Raspberry Pi

Connect the **LED to Port D4** and power on the Raspberry Pi, using the Grove wire connector. This is a test to make led blinking. You can connect to GrovePi+ with it as the picture below.

```
# GrovePi LED Blink example

import time
from grovepi import *

# Connect the Grove LED to digital port D4
led = 4

pinMode(led,"OUTPUT")
time.sleep(1)

while True:
    try:
        #Blink the LED
        digitalWrite(led,1)        # Send HIGH to switch on LED
        time.sleep(1)

        digitalWrite(led,0)        # Send LOW to switch off LED
        time.sleep(1)

    except KeyboardInterrupt:    # Turn LED off before stopping
        digitalWrite(led,0)
        break
    except IOError:                # Print "Error" if communication error encountered
        print "Error"
```

### Run The Program

* Find the path to the file(According to your own path)

  ```
  cd GrovePi/Software/Python/
  ```
* Run Program

  ```
  sudo python grove_led_blink.py
  ```

## Resources

* [Grove - LED V1.3 Source files (Eagle and pdf)](https://github.com/SeeedDocument/Grove-LED_Socket_Kit/raw/master/res/Grove-LED_v1.3_Schematics.zip)
* [Grove - LED Source files (Eagle and pdf)](https://github.com/SeeedDocument/Grove-LED_Socket_Kit/raw/master/res/Grove-LED_v1.0_Source_File.zip)
* [GroveLEDDemoCode](https://github.com/SeeedDocument/Grove-LED_Socket_Kit/raw/master/res/GroveLEDDemoCode.zip)
* [Grove-LED Socket Kit](https://github.com/SeeedDocument/Grove-LED_Socket_Kit/raw/master/res/Grove-LED_Socket_Eagle_File.zip)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.pakronics.com.au/seed-studio/grove-modules/display/grove-led_socket_kit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
