ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á

QQ怬

Ö»ÐèÒ»²½£¬¿ìËÙ¿ªÊ¼

ËÑË÷

arduino+moc33021+bta16ΪʲôɶֻÓа벨¿ØÖÆ£¬Çó´óÀнâÒÉ

²é¿´Êý: 2686 | ÆÀÂÛÊý: 10 | ÊÕ²Ø 0
¹ØµÆ | Ìáʾ£ºÖ§³Ö¼üÅÌ·­Ò³<-×ó ÓÒ->
    ×éͼ´ò¿ªÖУ¬ÇëÉÔºò......
·¢²¼Ê±¼ä: 2019-11-1 17:54

ÕýÎÄÕªÒª:

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

»Ø¸´

ID:342822 ·¢±íÓÚ 2019-11-5 13:01
jzli2019 ·¢±íÓÚ 2019-11-4 18:03
ÄãÓõÄÊÇÄĸö°æ±¾£¬ÎҸоõ¾ÍÊǰ汾²»¶Ôµ¼Öµġ£¡£¡£

ºÇºÇ8.8
ID:633947 ·¢±íÓÚ 2019-11-4 18:03
taotie ·¢±íÓÚ 2019-11-4 17:12
°´ÄãµÄ³ÌÐò·ÂÕæÃ»µÃÎÊÌâ¡£¡£

ÄãÓõÄÊÇÄĸö°æ±¾£¬ÎҸоõ¾ÍÊǰ汾²»¶Ôµ¼Öµġ£¡£¡£
ID:633947 ·¢±íÓÚ 2019-11-4 18:02
taotie ·¢±íÓÚ 2019-11-4 17:12
°´ÄãµÄ³ÌÐò·ÂÕæÃ»µÃÎÊÌâ¡£¡£

´óÀУ¬ÎÒ°Ñproteus8.7Ð¶ÔØÁËÖØÐÂ×°ÁËproteus8.9£¬ÏÖÔÚÄ£ÄâҲûÎÊÌâÁË¡£¡£¡£ºÜĪÃûÆäÃî°¡
ID:342822 ·¢±íÓÚ 2019-11-4 17:12
°´ÄãµÄ³ÌÐò·ÂÕæÃ»µÃÎÊÌâ¡£¡£


ID:342822 ·¢±íÓÚ 2019-11-4 16:24
jzli2019 ·¢±íÓÚ 2019-11-4 14:33
Õâ¸öÀý×ÓÃû³Æ½Ðʲô£¬ÎÒÏë¿´¿´ÍêÕûÏîÄ¿

Arduino Dimming 230V AC
ID:633947 ·¢±íÓÚ 2019-11-4 14:33
taotie ·¢±íÓÚ 2019-11-4 10:31
ÕâÊÇProteus 8 ÖеÄÀý³Ì¿´Ò»¿´°É
/* Main.ino file generated by New Project wizard
*

Õâ¸öÀý×ÓÃû³Æ½Ðʲô£¬ÎÒÏë¿´¿´ÍêÕûÏîÄ¿
ID:342822 ·¢±íÓÚ 2019-11-4 10:51
¼ì²âµ½¹ýÁãºóÑÓʱ5ms¿ØÖÆmoc3021¿ªÍ¨£¿£¿£¿£¿
ÓÃ10msÊÔÒ»ÊÔ~~
ID:342822 ·¢±íÓÚ 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 ·¢±íÓÚ 2019-11-4 09:37
ûÓÐÈËÂð£¿

СºÚÎÝ|51ºÚµç×ÓÂÛ̳ |51ºÚµç×ÓÂÛ̳6Ⱥ QQ ¹ÜÀíÔ±QQ:125739409;¼¼Êõ½»Á÷QQȺ281945664

Powered by µ¥Æ¬»ú½Ì³ÌÍø

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí