Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
562 B
3
Indexable
Never
    #define LED_hijau 13
    #define LED_biru 12
    #define LED_merah 11
    #define tombol 7

    int status = 0 ;
    void setup() {
    pinMode(LED_hijau, OUTPUT);
    pinMode(tombol, INPUT);
    pinMode(LED_biru, OUTPUT);
    pinMode(LED_merah, OUTPUT);
    digitalWrite(LED_hijau, LOW);
    digitalWrite(LED_biru, LOW);
    digitalWrite(LED_merah, LOW);
    }
    void loop() {
      
    if( digitalRead (tombol)==HIGH ) {
      status ++ ;
      delay(1000);
    }
    if(status == 1){
      digitalWrite(LED_hijau, HIGH);
    }
    else if(status == 2){
Leave a Comment