Relay SDK

From ElectroDragon
Revision as of 06:39, 22 December 2020 by Chao (talk | contribs) (Created page with "=== Demo Code === * Keil demo code for stc89s52 <syntaxhighlight lang="arduino"> int Relay = 3; void setup() { pinMode(Relay, OUTPUT);...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Demo Code

int Relay = 3;
 
void setup()
{
  pinMode(Relay, OUTPUT);     //Set Pin3 as output
}
void loop()
{
          digitalWrite(Relay, HIGH);   //Turn off relay
          delay(2000);
          digitalWrite(Relay, LOW);    //Turn on relay
          delay(2000);
}