English
EspaƱol
yt_link
insta_link
fb_link
twitter_link
ADVERTISERS
PCBWAY PCB Manufacturing

PCBWAY Christas PCB Manufacturing

Advanced PCB Manufacturing
Advanced PCB Manufacturing





AFFILATE










Gearbest Tronxy X8 220 x 220 x 200mm Desktop DIY 3D Printer
Tronxy X8 220 x 220 x 200mm Desktop DIY 3D Printer only $139.99

Gearbest Hubsan H117S Zino GPS 5.8G 1KM FPV with 4K UHD Camera 3-Axis Gimbal RC Drone - RTF
Hubsan H117S Zino GPS 5.8G 1KM FPV with 4K UHD Camera 3-Axis Gimbal RC Drone - RTF only $394.99

Gearbest 37-in-1 Sensor Modules Kit
37-in-1 Sensor Modules Kit only $13.99


Arduino AC inverter code


Download the .zip file below. Install it on your Arduino IDE.







/*
 * *This code will generate two inverted square signals on D3 and D5 of 62.5Hz.
 * http://www.electronoobs.com/eng_circuitos_tut14.php
 * http://www.youtube.com/c/ELECTRONOOBS
 */


//define the output pins
int mos_top = 3;
int mos_bot = 5;

void setup() {
  //define the pins as outputs
  pinMode(mos_top,OUTPUT);
  pinMode(mos_bot,OUTPUT);
  
  //Initial value is LOW
  digitalWrite(mos_top,LOW);
  digitalWrite(mos_bot,LOW);
}



void loop() {
  
  //One is LOW and other is HIGH
  digitalWrite(mos_top,LOW);  
  digitalWrite(mos_bot,HIGH);
  delay(8);    //  1/16ms = 62.5Hz

  //One is HIGH and other is LOW
  digitalWrite(mos_top,HIGH);
  digitalWrite(mos_bot,LOW);
  delay(8);

}