Skip to content

Instantly share code, notes, and snippets.

@dccourt
Created February 1, 2012 00:14
Show Gist options
  • Save dccourt/1714123 to your computer and use it in GitHub Desktop.
Save dccourt/1714123 to your computer and use it in GitHub Desktop.
Power interrupter sketch
// Power interrupter
#define POWER_OUT_PIN 4 // Note : sense is inverted, i.e. ON = LOW.
// Use of pin 4 on ATTiny allows for ISP-reprogramming
void setup()
{
pinMode(POWER_OUT_PIN, OUTPUT);
}
void loop()
{
digitalWrite(POWER_OUT_PIN, HIGH);
delay(2000); // leave off for 2 secs
digitalWrite(POWER_OUT_PIN, LOW);
for (int ii = 0; ii < 12; ii++)
{
delay(30000); // power on for 30 secs
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment