LAPORAN AKHIR MODUL 2 PERCOBAAN 3
1. Hardware [Kembali]
2. Rangkaian Simulasi [Kembali]
3. Flowchart [Kembali]
4. Listing Program [Kembali]
bbyte pot= A0;
byte motor=9;
byte motor1=10;
int nilai;
int output;
void setup() {
pinMode (motor,OUTPUT);
Serial.begin (9600);
}
void loop() {
analogWrite(motor1,255);
nilai= analogRead(pot);
output= map (nilai,0,1023,0,255);
Serial.print ("pontensiometer: ");
Serial.print (nilai);
Serial.print (" ");
Serial.print (output);
delay(2);
Serial.println ();
analogWrite(motor,output);
}
5. Analisa [Kembali]
pinMode (motor,OUTPUT);
Serial.begin (9600);
}
void loop() {
analogWrite(motor1,255);
nilai= analogRead(pot);
output= map (nilai,0,1023,0,255);
Serial.print ("pontensiometer: ");
Serial.print (nilai);
Serial.print (" ");
Serial.print (output);
delay(2);
Serial.println ();
analogWrite(motor,output);
}
Tidak ada komentar:
Posting Komentar