스위치로 LED 제어하기에서 코드 설명좀요..
물공 | 2016-02-19
|
|
---|---|
const int Button_Pin = 7;
const int Led_Pin = 13; void setup() {
pinMode(Button_Pin, INPUT); pinMode(Led_Pin, OUTPUT); } int old_button_state = LOW; int led_state = LOW; void loop() {
const int CURRENT_BUTTON_STATE = digitalRead(Button_Pin); if(CURRENT_BUTTON_STATE != old_button_state && CURRENT_BUTTON_STATE == HIGH){ if(led_state == LOW) led_state == HIGH) else led_state == LOW; digitalWrite(Led_Pin, led_state);
} old_button_state == CURRENT_BUTTON_STATE; } 질문입니다.
if(CURRENT_BUTTON_STATE != old_button_state && CURRENT_BUTTON_STATE == HIGH)
여기서 이 문장 해석족 부탁드립니다. 이해가 잘 안가네요..
|
|
이전글 | 포인트 | 2016-02-18 |
다음글 | 오렌지보드 Ble 블루투스 COM PORT를 알고싶습니다.... | 2016-02-19 |