1.Kondisi [Kembali]
Mengatur Kecepatan Putar MOTOR DC
2. Rangkaian Simulasi [Kembali]
3. Flowchart [Kembali]
4. Listing Program [Kembali]
byte port = A0;
byte motor = 9;
int nilai;
int output;
void setup() {
pinMode(motor, OUTPUT);
Serial.begin(9600);
}
void loop() {
nilai = analogRead(port);
output = map(nilai, 0, 1023, 0, 255);
analogWrite(motor, output);
Serial.print("potensiometer: ");
Serial.print(nilai);
Serial.print(" ");
Serial.print("output: ");
Serial.print(output);
delay(2);
}
int nilai;
int output;
void setup() {
pinMode(motor, OUTPUT);
Serial.begin(9600);
}
void loop() {
nilai = analogRead(port);
output = map(nilai, 0, 1023, 0, 255);
analogWrite(motor, output);
Serial.print("potensiometer: ");
Serial.print(nilai);
Serial.print(" ");
Serial.print("output: ");
Serial.print(output);
delay(2);
}
5. Video [Kembali]
Tidak ada komentar:
Posting Komentar