아두이노 Reed 자기 센서 제어
2019. 7. 9. 11:26ㆍ드론
Reed 센서는 자석을 접근시키면 자성이 유도되어서 접점이 접촉되는 센서. 코일 혹은 영구자석에 의해 리드의 양쪽에 N극과 S극이 유도되어 자기력에 동작된다
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int pinReed = 2; | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(115200); | |
pinMode(pinReed, INPUT); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
if(digitalRead(pinReed)) { | |
Serial.println("Mini Reed OFF"); | |
} | |
else { | |
Serial.println("Mini Reed ON"); | |
} | |
delay(500); | |
} |

'드론' 카테고리의 다른 글
아두이노 clcd 문자열 입력받아서 띄우기 (0) | 2019.07.09 |
---|---|
아두이노 인터럽트로 제어하는 HIT 센서 (0) | 2019.07.09 |
아두이노로 FND 6자리 출력하기 (0) | 2019.07.08 |
아두이노 스위치 입력 한번만 받기 (0) | 2019.07.08 |
아두이노 serialEvent 인터럽트 (0) | 2019.07.08 |