Saturday, 23 August 2014

Arduino Relay [Experiment _ 03]


Experiment _ 03
-Refer to "Calculations and Codes for Scaled down"http://sst2014-s201-g-iss.blogspot.sg/2014/08/calculations-and-codes-for-scaled-down.html

Codes:

#define RELAY1 8
#define RELAY2 7

void setup()
{  
  pinMode(RELAY1, OUTPUT);      
  pinMode(RELAY2, OUTPUT);

}

 void loop()
{

   digitalWrite(RELAY1,HIGH);
   delay(10000);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
   digitalWrite(RELAY1,HIGH);
   delay(12500);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
   digitalWrite(RELAY1,HIGH);
   delay(15000);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
   digitalWrite(RELAY1,HIGH);
   delay(17500);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
   digitalWrite(RELAY1,HIGH);
   delay(20000);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
   digitalWrite(RELAY1,HIGH); //START OF LINEAR
   delay(18960);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
   digitalWrite(RELAY1,HIGH);
   delay(18960);
   digitalWrite(RELAY1,LOW);
   delay(3090); //END OF LINEAR
 
   digitalWrite(RELAY1,HIGH);
   delay(20000);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
   digitalWrite(RELAY1,HIGH);
   delay(17500);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
   digitalWrite(RELAY1,HIGH);
   delay(15000);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
   digitalWrite(RELAY1,HIGH);
   delay(12500);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
   digitalWrite(RELAY1,HIGH);
   delay(10000);
   digitalWrite(RELAY1,LOW);
   delay(3090);
 
//END OF RELAY1
//START OF RELAY2
 
   digitalWrite(RELAY2,HIGH);
   delay(10000);
   digitalWrite(RELAY2,LOW);
   delay(3090);
 
   digitalWrite(RELAY2,HIGH);
   delay(12500);
   digitalWrite(RELAY2,LOW);
   delay(3090);
 
   digitalWrite(RELAY2,HIGH);
   delay(15000);
   digitalWrite(RELAY2,LOW);
   delay(3090);
 
   digitalWrite(RELAY2,HIGH);
   delay(17500);
   digitalWrite(RELAY2,LOW);
   delay(3090);
 
   digitalWrite(RELAY2,HIGH);
   delay(20000);
   digitalWrite(RELAY2,LOW);
   delay(3090);
 
   digitalWrite(RELAY2,HIGH); //START OF LINEAR
   delay(18960);
   digitalWrite(RELAY2,LOW);
   delay(3090);
 
   digitalWrite(RELAY2,HIGH);
   delay(18960);
   digitalWrite(RELAY2,LOW);
   delay(3090); //END OF LINEAR
 
   digitalWrite(RELAY2,HIGH);
   delay(20000);
   digitalWrite(RELAY2,LOW);
   delay(3090);
 
   digitalWrite(RELAY2,HIGH);
   delay(17500);
   digitalWrite(RELAY2,LOW);
   delay(3090);
 
   digitalWrite(RELAY2,HIGH);
   delay(15000);
   digitalWrite(RELAY2,LOW);
   delay(3090);
 
   digitalWrite(RELAY2,HIGH);
   delay(12500);
   digitalWrite(RELAY2,LOW);
   delay(3090);
 
   digitalWrite(RELAY2,HIGH);
   delay(10000);
   digitalWrite(RELAY2,LOW);
   delay(3090);

 

} //END OF CODE

No comments:

Post a Comment