일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- lambda
- STM32
- 급속충전기
- 안드로이드
- 파이썬
- 디자인패턴
- 플라스크
- 전기차
- 보안
- flask
- IOT Core
- Android
- 충전기
- 서버리스
- 홈어시스턴트
- AWS
- esp8266
- 완속충전기
- dynamodb
- 펌웨어
- 전기차충전
- homeassistant
- everon
- 전기차충전기
- thread
- 라즈베리파이
- YMODEM
- 에버온
- raspberry
- OCPP
Archives
- Today
- Total
Louie NRT Story
[RaspberryPi] Led Control 본문
반응형
Writed: 3 FEB 2020
1. Circuit diagram
2. GPIO Pin
3. Code
1) Use BCM
import RPi.GPIO as GPIO
import time
LED_PIN = 17
led_status = True
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED_PIN, GPIO.OUT)
try:
while True:
GPIO.output(LED_PIN, led_status)
print("LED_Status = ")
print(led_status)
led_status ^= True
time.sleep(5)
except KeyboardInterrupt:
GPIO.cleanup()
2) Use Board
import RPi.GPIO as GPIO
import time
LED_PIN = 11
led_status = True
GPIO.setmode(GPIO.BOARD)
GPIO.setup(LED_PIN, GPIO.OUT)
try:
while True:
GPIO.output(LED_PIN, led_status)
print("LED_Status = ")
print(led_status)
led_status ^= True
time.sleep(5)
except KeyboardInterrupt:
GPIO.cleanup()
4. ETC
GPIO.setup(11, GPIO.OUT)
#or
GPIO.setup(11, GPIO.IN)
5. Reference
반응형
'에너지' 카테고리의 다른 글
[LoRa] SystemBase Inc. uLory (0) | 2020.02.04 |
---|---|
[BlueTooth] HC-06 (0) | 2020.02.03 |
[나인와트] 2019 Incheon Civic Hack-Fair (0) | 2020.01.05 |
[기본상식] App 만드는 방법 (0) | 2019.12.26 |
[Node MCU ESP8266] Monitoring DHT11 via thingspeak (0) | 2019.12.24 |
Comments