Back
Raspberry Pi Home Server

Raspberry Pi Home Server

445 Views19 Likes0 Comments12/29/2025

Set up a home server with Raspberry Pi. Host websites, file storage, and home automation services.

Code Examples

1 example
GPIO LED Control
Python
19 lines
led_control.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class="text-gray-class="text-purple-400">500 italic"># Raspberry Pi GPIO LED Control
import RPi.GPIO as GPIO
import time

LED_PIN = class="text-purple-400">18

GPIO.setmode(GPIO.BCM)
GPIO.setup(LED_PIN, GPIO.OUT)

try:
    while True:
        GPIO.output(LED_PIN, GPIO.HIGH)
        print(class="text-green-class="text-purple-400">400">"LED ON")
        time.sleep(class="text-purple-400">1)
        GPIO.output(LED_PIN, GPIO.LOW)
        print(class="text-green-class="text-purple-400">400">"LED OFF")
        time.sleep(class="text-purple-400">1)
except KeyboardInterrupt:
    GPIO.cleanup()
Comments (0)

Please login to leave a comment

No comments yet. Be the first to comment!

K

keyestudio Robot

Creator