Skip to content

Instantly share code, notes, and snippets.

@giljr
Created November 14, 2018 02:21
Show Gist options
  • Save giljr/c97facd8d07b427e5ea28fd2221698c0 to your computer and use it in GitHub Desktop.
Save giljr/c97facd8d07b427e5ea28fd2221698c0 to your computer and use it in GitHub Desktop.
#define control1 8 // pin that controls the MOSFET
#define control2 9 // pin that controls the MOSFET
void setup() {
pinMode(control1, OUTPUT); // define control pin as output
pinMode(control2, OUTPUT); // define control pin as output
Serial.begin(9600);
}
void loop() {
digitalWrite(control1, HIGH); // turn the MOSFET Switch ON
digitalWrite(control2, HIGH); // turn the MOSFET Switch ON
delay(2000); // Wait for 2000 ms or 2 second
digitalWrite(control1, LOW); // Turn the MOSFET Switch OFF
digitalWrite(control2, LOW); // Turn the MOSFET Switch OFF
delay(2000); // Wait for 2000 ms or 2 second
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment