找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索

arduino+moc33021+bta16為什么啥只有半波控制,求大佬解疑

查看數(shù): 2681 | 評(píng)論數(shù): 10 | 收藏 0
關(guān)燈 | 提示:支持鍵盤翻頁<-左 右->
    組圖打開中,請(qǐng)稍候......
發(fā)布時(shí)間: 2019-11-1 17:54

正文摘要:

void up() {   digitalWrite(12, HIGH);   delayMicroseconds(5000);   digitalWrite(12, LOW);   delayMicroseconds(1000);   digitalWrite(12, HIGH); ...

回復(fù)

ID:342822 發(fā)表于 2019-11-5 13:01
jzli2019 發(fā)表于 2019-11-4 18:03
你用的是哪個(gè)版本,我感覺就是版本不對(duì)導(dǎo)致的。。。

呵呵8.8
ID:633947 發(fā)表于 2019-11-4 18:03
taotie 發(fā)表于 2019-11-4 17:12
按你的程序仿真沒得問題。。

你用的是哪個(gè)版本,我感覺就是版本不對(duì)導(dǎo)致的。。。
ID:633947 發(fā)表于 2019-11-4 18:02
taotie 發(fā)表于 2019-11-4 17:12
按你的程序仿真沒得問題。。

大佬,我把proteus8.7卸載了重新裝了proteus8.9,現(xiàn)在模擬也沒問題了。。。很莫名其妙啊
ID:342822 發(fā)表于 2019-11-4 17:12
按你的程序仿真沒得問題。。


ID:342822 發(fā)表于 2019-11-4 16:24
jzli2019 發(fā)表于 2019-11-4 14:33
這個(gè)例子名稱叫什么,我想看看完整項(xiàng)目

Arduino Dimming 230V AC
ID:633947 發(fā)表于 2019-11-4 14:33
taotie 發(fā)表于 2019-11-4 10:31
這是Proteus 8 中的例程看一看吧
/* Main.ino file generated by New Project wizard
*

這個(gè)例子名稱叫什么,我想看看完整項(xiàng)目
ID:342822 發(fā)表于 2019-11-4 10:51
檢測到過零后延時(shí)5ms控制moc3021開通????
用10ms試一試~~
ID:342822 發(fā)表于 2019-11-4 10:31

這是Proteus 8 中的例程看一看吧
/* Main.ino file generated by New Project wizard
*
* Created:   mer ago 22 2018
* Processor: Arduino Uno
* Compiler:  Arduino AVR
*/

int AC_LOAD = 3;    // Output to Opto Triac pin
int dimming = 128;  // Dimming level (0-128)  0 = ON, 128 = OFF

void setup()
{
  pinMode(AC_LOAD, OUTPUT);// Set AC Load pin as output
  attachInterrupt(0, zero_crosss_int, RISING);  // Choose the zero cross interrupt # from the table above
}

//the interrupt function must take no parameters and return nothing
void zero_crosss_int()  //function to be fired at the zero crossing to dim the light
{
  // Firing angle calculation : 1 full 50Hz wave =1/50=20ms
  // Every zerocrossing thus: (50Hz)-> 10ms (1/2 Cycle)
  // For 60Hz => 8.33ms (10.000/120)
  // 10ms=10000us
  // (10000us - 10us) / 128 = 75 (Approx) For 60Hz =>65

  int dimtime = (75*dimming);    // For 60Hz =>65   
  delayMicroseconds(dimtime);    // Wait till firing the TRIAC
  digitalWrite(AC_LOAD, HIGH);   // Fire the TRIAC
  delayMicroseconds(10);         // triac On propogation delay (for 60Hz use 8.33)
  digitalWrite(AC_LOAD, LOW);    // No longer trigger the TRIAC (the next zero crossing will swith it off) TRIAC
}

void loop()  {
  for (int i=5; i <= 128; i++){
    dimming=i;
    delay(10);
   }
}
ID:633947 發(fā)表于 2019-11-4 09:37
沒有人嗎?

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表