Arduino grove 繼電器

繼電器   arduino

SIG    ->    D4

VCC ->     5V

GND  -> GND

 

int relayPin = 4;
void setup() {
  // put your setup code here, to run once:
  pinMode(relayPin, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(relayPin,HIGH);
  delay(2000);
  digitalWrite(relayPin,LOW);
  delay(2000);
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章