Hey everybody this is my first post and I just ordered my first arduino so I'm very anxious I to get started, this is my first code:
I decide to skip the traditional Blinking LED (though I want to integrate it in) and went for a mosfet inverter that operates at 60 Hz - it will only be a square wave but I'll develop it as I get more confident in programming.
I would appreciate any feedback on the code itself:
other than actually acting as a switching power supply; I also want a visual indication that is running so and LED out of pin 8 will be occurring (my main question is how to I get two loops Running together in order to generate a inverter with a blinking LED that will allow the Inverter not to be affected by time).
Also is there any good free ebooks to help progress my learning?
Thanks so much
Nick
h/* Inverter Full Bridge Rectifier - Square Wave Inteverter operating at 60 Hertz */
int POT = 4;//Postive waveform ON TOP MOSFET OF BRIDGE RECTIFIER
int POB = 5;//Positive waveform ON BOTTOM MOSFET OF BRIDGE RECTIFIER
int NOT = 6;//Negative Waveform ON TOP MOSFET OF BRIDGE RECTIFIER
int NOB = 7;//Negative Waveform ON BOTTOM MOSFET OF BRIDGE RECTIFIER
int LED = 8;//LED to indicate circuit is running
void setup(){
pinMode(POT, OUTPUT);//Enable POT AS AN OUTPUT
pinMode (POB, OUTPUT);//ENABLE POB AS AN OUTPUT
pinMode (NOT, OUTPUT);//ENABLE NOT AS AN OUTPUT
pinMode (NOB, OUTPUT);//ENABLE NOT AS AN OUTPUT
pinMode (LED, OUTPUT);//ENABLE LED AS AN OUTPUT
}
void loop(){
digitalWrite (LED,HIGH);//Displays Circuit is running
digitalWrite(POT & POB, HIGH); //ENABLE CURRENT PATH FOR POSITIVE WAVEFORM
delay(8.333333);//DELAY IS ESTABLISHED BY 1/(602)= 8.333333 mS
digitalWrite(POT & POB, LOW); //disable current path for positve waveform
digitalWrite(NOT & NOB, HIGH);// enable current path for negative waveform
delay(8.333333);////DELAY IS ESTABLISHED BY 1/(602)= 8.333333 mS
digitalWrite (NOT & NOB , LOW);// disable current path for negative waveform