Skip to content

Commit 521ab5a

Browse files
authored
LED Module README (#183)
* Create README.md * Update README.md
1 parent 5c4521b commit 521ab5a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

src/edgepi/led/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# EdgePi LED Module
2+
3+
# Hardware
4+
5+
The EdgePi has an array of eight programmable LED lights. The LED module allows users to interact with each LED individually.
6+
7+
# Example Code
8+
This code example demonstrates how to use the LED module to turn an LED on and off:
9+
```
10+
from edgepi.led.edgepi_leds import EdgePiLED
11+
from edgepi.gpio.gpio_configs import LEDPins
12+
13+
leds = EdgePiLED()
14+
15+
leds.turn_on(LEDPins.LED_OVR1)
16+
17+
leds.turn_off(LEDPins.LED_OVR1)
18+
```
19+
20+
# Functionalities
21+
22+
Currently, the LED module offers the following functionalities:
23+
1. Turn an LED on or off.
24+
2. Toggle an LED to the opposite state.
25+
3. Read an LED's on/off state.
26+
27+
# User Guide
28+
29+
## Turn an LED on/off
30+
```
31+
leds.turn_on(LEDPins.LED_OVR1)
32+
33+
leds.turn_off(LEDPins.LED_OVR1)
34+
```
35+
36+
## Toggle an LED to the opposite state
37+
```
38+
leds.toggle_led(LEDPins.LED_OVR1)
39+
```
40+
41+
## Read an LED's on/off state
42+
```
43+
state = leds.get_led_state(LEDPins.LED_OVR1)
44+
```
45+
46+
# Limitations

0 commit comments

Comments
 (0)