Automatické spínání 3 relat v čase
Moderátor: Moderátoři
Kód: Vybrat vše
Example
int ledPin = 13; // LED connected to digital pin 13
int cnt;
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}
void loop()
{
if (cnt<10){
digitalWrite(ledPin, HIGH); // sets the LED on
}
else{
digitalWrite(ledPin, LOW); // sets the LED off
}
delay(1000); // waits for a second
cnt++;
if (cnt>=600) cnt =0;
}