Unit 1: System Warning Light

 

Code: 


// Define the pin connected to the green light
#define GREEN_OP_SYSTEM 8

// The setup function runs once when the board powers up or resets
void setup() {
  pinMode(GREEN_OP_SYSTEM, OUTPUT);  // Set the green pin as an output
}

// The loop function runs over and over again
void loop() {
  digitalWrite(GREEN_OP_SYSTEM, HIGH);  // Turn the green light on
  delay(10000);                         // Wait for 10 seconds (10,000 milliseconds)

  digitalWrite(GREEN_OP_SYSTEM, LOW);   // Turn the green light off
  delay(100);                           // Brief pause before repeating
}

 

Notes: