Skip to content

Instantly share code, notes, and snippets.

@OMikeGray
Last active December 6, 2022 09:49
Show Gist options
  • Save OMikeGray/6bf644b6cda85bfe8c898ccd44ec6d78 to your computer and use it in GitHub Desktop.
Save OMikeGray/6bf644b6cda85bfe8c898ccd44ec6d78 to your computer and use it in GitHub Desktop.
Relay Example
/* Firgelli Automations
* Limited or no support: we do not have the resources for Arduino code support
*/
void setup() {
pinMode(7, OUTPUT); // Configure pin 7 as an Output
pinMode(8, OUTPUT); // Configure pin 8 as an Output
digitalWrite(7, HIGH); // Initialize pin 7 as Low
digitalWrite(8, HIGH); // Initialize pin 7 as Low
}
void loop() {
// Extend Linear Actuator
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
delay(2000); // 2 seconds
// Stops Actuator
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
delay(2000); // 2 seconds
// Retracts Linear Actuator
digitalWrite(7, HIGH);
digitalWrite(8, LOW);
delay(2000); // 2 seconds
// Stop Actuator
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
delay(2000); // 2 seconds
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment