int MOSFET1 = 3; //MOSFET1 connected to pin
int MOSFET2 = 5; //MOSFET2 connected to pin
int MOSFET3 = 6; //MOSFET3 connected to pin
int MOSFET4 = 9; //MOSFET4 connected to pin
int MOSFET5 = 10; //MOSFET5 connected to pin
int MOSFET6 = 11; //MOSFET6 connected to pin
int RECTarray [] = {0,167,500,833,1167,1500,1834,2000};
void setup() {
// put your setup code here, to run once:
pinMode(MOSFET1, OUTPUT); //sets digital pin as output
pinMode(MOSFET2, OUTPUT); //sets digital pin as output
pinMode(MOSFET3, OUTPUT); //sets digital pin as output
pinMode(MOSFET4, OUTPUT);
pinMode(MOSFET5, OUTPUT);
pinMode(MOSFET6, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(MOSFET1, LOW);
digitalWrite(MOSFET2, LOW);
digitalWrite(MOSFET4, LOW);
digitalWrite(MOSFET5, LOW);
digitalWrite(MOSFET6, LOW);
digitalWrite(MOSFET3, HIGH);
delayMicroseconds(RECTarray[1]*10);
digitalWrite(MOSFET3, LOW);
digitalWrite(MOSFET1, HIGH);
digitalWrite(MOSFET2, HIGH);
delayMicroseconds((RECTarray[2]-RECTarray[1])*10);
digitalWrite(MOSFET2, LOW);
digitalWrite(MOSFET6, HIGH);
delayMicroseconds((RECTarray[3]-RECTarray[2])*10);
digitalWrite(MOSFET1, LOW);
digitalWrite(MOSFET5, HIGH);
delayMicroseconds((RECTarray[4]-RECTarray[3])*10);
digitalWrite(MOSFET6, LOW);
digitalWrite(MOSFET4, HIGH);
delayMicroseconds((RECTarray[5]-RECTarray[4])*10);
digitalWrite(MOSFET5, LOW);
digitalWrite(MOSFET3, HIGH);
delayMicroseconds((RECTarray[6]-RECTarray[5])*10);
digitalWrite(MOSFET4, LOW);
digitalWrite(MOSFET2, HIGH);
delayMicroseconds((RECTarray[7]-RECTarray[6])*10);
}