User Tools

Site Tools

한국어

faduino:toggling_the_digital_outputs:index

Toggling a Digital Output (FA-DUINO-18TA / 32TA)

The following program will periodically toggle digital output 38 along with the status LED.

const int StatusLED = 13;
const int Sink38 = 38;
 
void setup() {
   pinMode(StatusLED, OUTPUT);
   pinMode(Sink38 , OUTPUT);
}
 
void loop() {
    digitalWrite(StatusLED, HIGH);
    digitalWrite(Sink38 , HIGH);
    delay(1000);
    digitalWrite(StatusLED, LOW);
    digitalWrite(Sink38 , LOW);
    delay(1000);
} 

Toggling an Output Relay (FA-DUINO-12RA / 24RA)

The following program will periodically toggle output 22 and the status LED

const int StatusLED = 13;
const int Relay22 = 22;
void setup() {
   pinMode(StatusLED, OUTPUT);
   pinMode(Relay22 , OUTPUT);
}
void loop() {
    digitalWrite(StatusLED, HIGH);
    digitalWrite(Relay22, HIGH);
    delay(1000);
    digitalWrite(StatusLED, LOW);
    digitalWrite(Relay22, LOW);
    delay(1000);
} 
faduino/toggling_the_digital_outputs/index.txt · Last modified: 2020/03/04 17:21 by COMFILE Technology