繼電器:信號線接Arduino 10引腳,5伏接面包板,gnd接面包板,公共口接330歐電阻上,常開口接面包板上。
ard:gnd接led陰極,5v接面包板
led:陽極連在電阻上
Arduino輸出控制
int realy = 10;
void setup() {
// put your setup code here, to run once:
pinMode(realy, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(realy, HIGH);
delay(1000);
digitalWrite(realy,LOW);
delay(1000);
}


返回頂部
刷新頁面
下到頁底