Page 131 - EMODUL TEKNIK KENDALI DIGITAL FT
P. 131

Universitas Negeri Makassar           118







                                  button1 = 1;
                                }

                                else
                                  button1 =0;

                                if (button1 == 1){

                                  digitalWrite(ledPin1, HIGH);
                                }

                                else
                                  digitalWrite(ledPin1, LOW);

                              }


                              //button 2

                              if (BUTTONPRESSED == IRButton2){
                                if (button2 == 0){

                                  button2 = 1;

                                }
                                else

                                  button2 =0;
                                if (button2 == 1){

                                  digitalWrite(ledPin2, HIGH);
                                }

                                else

                                  digitalWrite(ledPin2, LOW);
                              }


                              //button 3

                              if (BUTTONPRESSED == IRButton3){
                                if (button3 == 0){

                                  button3 = 1;

                                }
                                else

                                  button3 =0;

                                if (button3 == 1){
                                  digitalWrite(ledPin3, HIGH);

                                }
                                else

                                  digitalWrite(ledPin3, LOW);
                              }





                  TEKNIK KENDALI DIGITAL | UNM
   126   127   128   129   130   131   132   133   134   135   136