|
|
void up()
{
digitalWrite(12, HIGH);
delayMicroseconds(5000);
digitalWrite(12, LOW);
delayMicroseconds(1000);
digitalWrite(12, HIGH);
}
void setup() {
pinMode(2, INPUT);
pinMode(12, OUTPUT);
// put your setup code here, to run once:
attachInterrupt(0, up, RISING);
}
void loop() {
// put your main code here, to run repeatedly:
delay(100);
}
這個(gè)是arduino代碼,檢測到過零后延時(shí)5ms控制moc3021開通。
不知道為什么只有在220v的負(fù)半波能開通可控硅,正的半波一點(diǎn)反應(yīng)都沒有,可控硅觸發(fā)電路是參考的moc3021手冊(cè)推薦電路,是不是proteus仿真元件有問題?moc3021?bta16-600bw?
|
-
-
-
-
Arduino 328.rar
2019-11-1 17:52 上傳
點(diǎn)擊文件名下載附件
92.11 KB, 下載次數(shù): 12
proteus項(xiàng)目文件
|