Just another free Blogger theme

*Klik teks untuk menuju

1. Prosedur [Kembali]

Langkah-langkah percobaan :

1. Siapkan alat dan bahan yaitu dengan komponen utama Arduino Uno, Infrared Sensor, IC I2C, Keypad dan Motor DC

2. Rangkai sesuai gambar percobaan

3. Rancang kerja rangkaian sesuai flowchat

4. Tekan tombol “Play” untuk menjalankan simulasi


2. Hardaware dan Diagram Blok [Kembali]

  • Arduino
  • LCD
  • Motor DC








3. Rangkaian Simulasi dan Prinsip Kerja [Kembali]








 Prinsip Kerja

Pada Rangkaian ini semua switch pull down dimana ketika switch 1,3 hidup maka motor akan berputar ke kiri dan ketika switch 2,4 motor akan berputar ke kanan 
4. Flowchart dan listing Program [Kembali]

Flowchart :



Listing Program :
const int switch1Pin = A0; // Switch 1 connected to pin A0
const int switch2Pin = A1; // Switch 2 connected to pin A1
const int switch3Pin = A2; // Switch 3 connected to pin A2
const int switch4Pin = A3; // Switch 4 connected to pin A3

const int pin3Output = 3; // Output pin connected to pin 3
const int pin4Output = 4; // Output pin connected to pin 4

void setup() {
  pinMode(switch1Pin, INPUT); // Set switch 1 pin as input
  pinMode(switch2Pin, INPUT); // Set switch 2 pin as input
  pinMode(switch3Pin, INPUT); // Set switch 3 pin as input
  pinMode(switch4Pin, INPUT); // Set switch 4 pin as input

  pinMode(pin3Output, OUTPUT); // Set pin 3 output pin
  pinMode(pin4Output, OUTPUT); // Set pin 4 output pin
}

void loop() {
  // Read the state of all switches
  int switch1State = digitalRead(switch1Pin);
  int switch2State = digitalRead(switch2Pin);
  int switch3State = digitalRead(switch3Pin);
  int switch4State = digitalRead(switch4Pin);

  // Check if all switches are active (LOW)
  if (switch1State == HIGH && switch2State == HIGH && switch3State == HIGH && switch4State == HIGH) {
    digitalWrite(pin3Output, LOW); // Set pin 3 output to LOW
    digitalWrite(pin4Output, LOW); // Set pin 4 output to LOW
  } else {
    // Check if switch 1 and switch 3 are pressed
    if (switch1State == HIGH && switch3State == HIGH) {
      digitalWrite(pin3Output, HIGH); // Set pin 3 output to HIGH
    } else {
      digitalWrite(pin3Output, LOW); // Set pin 3 output to LOW
    }

    // Check if switch 2 and switch 4 are pressed
    if (switch2State == HIGH && switch4State == HIGH) {
      digitalWrite(pin4Output, HIGH); // Set pin 4 output to HIGH
    } else {
      digitalWrite(pin4Output, LOW); // Set pin 4 output to LOW
    }
  }
}

5. Kondisi [Kembali]

    Semua Switch pull-down, switch 1 dan 3 motor ke kiri, switch 2 dan 4 panah ke kanan dan motor  ke kanan

6. Video Simulasi [Kembali]




7. Download File [Kembali]
HTML Disini
Simulasi Disini
Video Simulasi Disini
Listing Program Di sini
DataSheet LCD Disini 













0 komentar:

Posting Komentar