Relay SDK

From ElectroDragon Wiki
Revision as of 18: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)

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);
}