วันพฤหัสบดีที่ 28 ธันวาคม พ.ศ. 2560

Arduino power inverter

PROGRAM FOR 50Hz

void setup()
{               
  pinMode(7, OUTPUT);  pinMode(8, OUTPUT);     
}
void loop()
{
digitalWrite(7, HIGH);
delayMicroseconds(15);
  digitalWrite(7, LOW);
delayMicroseconds(285);

digitalWrite(7, HIGH);
delayMicroseconds(30);
  digitalWrite(7, LOW);
delayMicroseconds(270);

digitalWrite(7, HIGH);
delayMicroseconds(45);
  digitalWrite(7, LOW);
delayMicroseconds(255);

digitalWrite(7, HIGH);
delayMicroseconds(60);
  digitalWrite(7, LOW);
delayMicroseconds(240);

digitalWrite(7, HIGH);
delayMicroseconds(75);
  digitalWrite(7, LOW);
delayMicroseconds(225);

digitalWrite(7, HIGH);
delayMicroseconds(90);
  digitalWrite(7, LOW);
delayMicroseconds(210);

digitalWrite(7, HIGH);
delayMicroseconds(105);
  digitalWrite(7, LOW);
delayMicroseconds(195);

digitalWrite(7, HIGH);
delayMicroseconds(120);
  digitalWrite(7, LOW);
delayMicroseconds(180);

digitalWrite(7, HIGH);
delayMicroseconds(135);
  digitalWrite(7, LOW);
delayMicroseconds(165);

digitalWrite(7, HIGH);
delayMicroseconds(150);
  digitalWrite(7, LOW);
delayMicroseconds(150);
                
digitalWrite(7, HIGH);
delayMicroseconds(165);
  digitalWrite(7, LOW);
delayMicroseconds(135);

digitalWrite(7, HIGH);
delayMicroseconds(195);
  digitalWrite(7, LOW);
delayMicroseconds(105);

digitalWrite(7, HIGH);
delayMicroseconds(225);
  digitalWrite(7, LOW);
delayMicroseconds(75);

digitalWrite(7, HIGH);
delayMicroseconds(255);
  digitalWrite(7, LOW);
delayMicroseconds(45);

digitalWrite(7, HIGH);
delayMicroseconds(270);
digitalWrite(7, LOW);
delayMicroseconds(30);

digitalWrite(7, HIGH);
delayMicroseconds(285);
  digitalWrite(7, LOW);
delayMicroseconds(15);

digitalWrite(7, HIGH);
delayMicroseconds(270);
  digitalWrite(7, LOW);
delayMicroseconds(30);

digitalWrite(7, HIGH);
delayMicroseconds(255);
  digitalWrite(7, LOW);
delayMicroseconds(45);

digitalWrite(7, HIGH);
delayMicroseconds(225);
  digitalWrite(7, LOW);
delayMicroseconds(75);


digitalWrite(7, HIGH);
delayMicroseconds(195);
  digitalWrite(7, LOW);
delayMicroseconds(105);


digitalWrite(7, HIGH);
delayMicroseconds(165);
  digitalWrite(7, LOW);
delayMicroseconds(135);

digitalWrite(7, HIGH);
delayMicroseconds(150);
  digitalWrite(7, LOW);
delayMicroseconds(150);

digitalWrite(7, HIGH);
delayMicroseconds(135);
  digitalWrite(7, LOW);
delayMicroseconds(165);
digitalWrite(7, HIGH);
delayMicroseconds(120);
  digitalWrite(7, LOW);
delayMicroseconds(180);

digitalWrite(7, HIGH);
delayMicroseconds(105);
  digitalWrite(7, LOW);
delayMicroseconds(195);

digitalWrite(7, HIGH);
delayMicroseconds(90);
  digitalWrite(7, LOW);
delayMicroseconds(210);

digitalWrite(7, HIGH);
delayMicroseconds(75);
  digitalWrite(7, LOW);
delayMicroseconds(225);
digitalWrite(7, HIGH);
delayMicroseconds(60);
  digitalWrite(7, LOW);
delayMicroseconds(240);
digitalWrite(7, HIGH);
delayMicroseconds(45);
  digitalWrite(7, LOW);
delayMicroseconds(255);
digitalWrite(7, HIGH);
delayMicroseconds(30);
  digitalWrite(7, LOW);
delayMicroseconds(270);
digitalWrite(7, HIGH);
delayMicroseconds(15);
  digitalWrite(7, LOW);
delayMicroseconds(285);


digitalWrite(8, HIGH); //22
delayMicroseconds(15);
  digitalWrite(8, LOW);
delayMicroseconds(285);
digitalWrite(8, HIGH);
delayMicroseconds(30);
  digitalWrite(8, LOW);
delayMicroseconds(270);
digitalWrite(8, HIGH);
delayMicroseconds(45);
  digitalWrite(8, LOW);
delayMicroseconds(255);
digitalWrite(8, HIGH);
delayMicroseconds(60);
  digitalWrite(8, LOW);
delayMicroseconds(240);
digitalWrite(8, HIGH);
delayMicroseconds(75);
  digitalWrite(8, LOW);
delayMicroseconds(225);

digitalWrite(8, HIGH);
delayMicroseconds(90);
  digitalWrite(8, LOW);
delayMicroseconds(210);

digitalWrite(8, HIGH);
delayMicroseconds(105);
  digitalWrite(8, LOW);
delayMicroseconds(195);
digitalWrite(8, HIGH);
delayMicroseconds(120);
  digitalWrite(8, LOW);
delayMicroseconds(180);
digitalWrite(8, HIGH);
delayMicroseconds(135);
  digitalWrite(8, LOW);
delayMicroseconds(165);

digitalWrite(8, HIGH);
delayMicroseconds(150);
  digitalWrite(8, LOW);
delayMicroseconds(150);

digitalWrite(8, HIGH);
delayMicroseconds(165);
  digitalWrite(8, LOW);
delayMicroseconds(135);

digitalWrite(8, HIGH);
delayMicroseconds(195);
  digitalWrite(8, LOW);
delayMicroseconds(105);

digitalWrite(8, HIGH);
delayMicroseconds(225);
  digitalWrite(8, LOW);
delayMicroseconds(75);


digitalWrite(8, HIGH);
delayMicroseconds(255);
  digitalWrite(8, LOW);
delayMicroseconds(45);

digitalWrite(8, HIGH);
delayMicroseconds(270);
  digitalWrite(8, LOW);
delayMicroseconds(30);

digitalWrite(8, HIGH);
delayMicroseconds(285);
  digitalWrite(8, LOW);
delayMicroseconds(15);

digitalWrite(8, HIGH);
delayMicroseconds(270);
  digitalWrite(8, LOW);
delayMicroseconds(30);

digitalWrite(8, HIGH);
delayMicroseconds(255);
  digitalWrite(8, LOW);
delayMicroseconds(45 );

digitalWrite(8, HIGH);
delayMicroseconds(225);
  digitalWrite(8, LOW);
delayMicroseconds(75);


digitalWrite(8, HIGH);
delayMicroseconds(195);
  digitalWrite(8, LOW);
delayMicroseconds(105);


digitalWrite(8, HIGH);
delayMicroseconds(165);
  digitalWrite(8, LOW);
delayMicroseconds(135);

digitalWrite(8, HIGH);
delayMicroseconds(150);
  digitalWrite(8, LOW);
delayMicroseconds(150);

digitalWrite(8, HIGH);
delayMicroseconds(135);
  digitalWrite(8, LOW);
delayMicroseconds(165);
digitalWrite(8, HIGH);
delayMicroseconds(120);
  digitalWrite(8, LOW);
delayMicroseconds(180);
digitalWrite(8, HIGH);
delayMicroseconds(105);
  digitalWrite(8, LOW);
delayMicroseconds(195);
digitalWrite(8, HIGH);
delayMicroseconds(90);
  digitalWrite(8, LOW);
delayMicroseconds(210);

digitalWrite(8, HIGH);
delayMicroseconds(75);
  digitalWrite(8, LOW);
delayMicroseconds(225);
digitalWrite(8, HIGH);
delayMicroseconds(60);
  digitalWrite(8, LOW);
delayMicroseconds(240);
digitalWrite(8, HIGH);
delayMicroseconds(45);
  digitalWrite(8, LOW);
delayMicroseconds(255);
digitalWrite(8, HIGH);
delayMicroseconds(30);
  digitalWrite(8, LOW);
delayMicroseconds(270);
digitalWrite(8, HIGH);
delayMicroseconds(15);
  digitalWrite(8, LOW);
delayMicroseconds(285);
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น