Page 59 - E-Modul Sensor dan Tranduser
P. 59

Gambar 3.3. Memasukan Kode Program




                    b. Mengetikan kode program pada sketch

                    Tuliskan source kode dibawah ini pada layar

                    editor arduino :

                    // coba 1 led – Program untuk menghidupkan

                    LED berkedip-kedip

                    const int PIN_12 = 12;

                    void setup() {


                      pinMode(PIN_12, OUTPUT);

                    }

                    void loop() {

                      digitalWrite(PIN_12, HIGH);

                      delay(1000); // Tunda 1 detik

                      digitalWrite(PIN_12, LOW);

                      delay(1000);

                    }
   54   55   56   57   58   59   60   61   62   63   64