일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 전기차충전
- 전기차
- 완속충전기
- 라즈베리파이
- 에버온
- dynamodb
- esp8266
- Android
- lambda
- 디자인패턴
- YMODEM
- 서버리스
- AWS
- 전기차충전기
- 파이썬
- OCPP
- 플라스크
- thread
- flask
- STM32
- 홈어시스턴트
- raspberry
- 충전기
- 안드로이드
- 보안
- IOT Core
- 펌웨어
- 급속충전기
- everon
- homeassistant
Archives
- Today
- Total
Louie NRT Story
[RaspberryPi] Controll LED 본문
반응형
[Design]
[RaspberryPi Code]
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
|
#include <stdio.h>
#include <wiringPi.h>
#define LED_PIN 27 // pin number
#define BT_PIN 0
int main(void){
// wiringPi setup
if(wiringPiSetup() == -1){
return -1;
}
// pin = 27
pinMode(LED_PIN, OUTPUT);
pinMode(BT_PIN, INPUT);
pullUpDnControl(BT_PIN, PUD_UP);
// LED toggle
while(1){
if(!(digitalRead(BT_PIN)))
{
digitalWrite(LED_PIN,1); // pin 27, input 1, light ON
delay(500); // Delay 0.5 sec
digitalWrite(LED_PIN,0); // light OFF
delay(500); // Delay 0.5 sec
}
}
return 0;
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4f; text-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none; color:white">cs |
반응형
'에너지' 카테고리의 다른 글
[Raspberry Pi] Install Raspbian on Raspberry Pi (0) | 2019.10.23 |
---|---|
[RaspberryPi] Thread & Shared Memory & USB Serial Data (0) | 2019.05.06 |
[RasbperryPi] Shared Memory Queue (0) | 2019.05.06 |
[RaspberryPi] Chatting Program using Shared Memory Flag (0) | 2019.05.06 |
[RaspberryPI] Remote control Car And Camera (0) | 2019.01.20 |
Comments