Skip to content

Instantly share code, notes, and snippets.

@giljr
Created November 14, 2018 02:19
Show Gist options
  • Save giljr/619da79f68fc6193930760f456558b10 to your computer and use it in GitHub Desktop.
Save giljr/619da79f68fc6193930760f456558b10 to your computer and use it in GitHub Desktop.
#define control 8 // pin that controls the MOSFET
void setup() {
// IRF520 MOSFET
pinMode(control, OUTPUT); // define control pin as output
Serial.begin(9600);
}
void loop() {
// IRF520 MOSFET
digitalWrite(control, HIGH); // turn the MOSFET Switch ON
delay(2000); // Wait for 2000 ms or 2 second
digitalWrite(control, 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