1. Kondisi [kembali]
Percobaan : 1 (Menjalankan motor DC)
Kondisi : 7 (Buatlah vehicle maju konstan dengan kecepatan setengah maksimum)
2. Rangkaian Simulasi [Kembali]
3. Flowchart [kembali]
4. Listing Program [kembali]
#define in1 9
#define in2 8
#define in3 5
#define in4 4
int pwm1 = 10;
int pwm2 = 6;
void setup() {
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);
pinMode(pwm1, OUTPUT);
pinMode(pwm2, OUTPUT);
}
void loop() {
motor1();
delay (2000);
motor2();
delay (2000);
}
void motor1()
{
digitalWrite(in1,HIGH);
digitalWrite(in2,LOW);
analogWrite(pwm1, 255);
delay(2000);
}
void motor2()
{
digitalWrite(in3,LOW);
digitalWrite(in4,HIGH);
analogWrite(pwm2, 125);
delay(2000);
}
5. Video [kembali]
6. Link Download [kembali]
A. Video Tugas Pendahuluan [Download] / [Link Youtube]
B. Rangkaian Simulasi [Download]
C. Program Arduino [Download]
D. HTML [Download]
Tidak ada komentar:
Posting Komentar