Tugas Pendahuluan Modul 2
1. Kondisi [kembali]
Kondisi potensiometer 100%
2. Gambar Rangkaian Simulasi [kembali]
3. Flowchart [kembali]
4. Listing Program [kembali]
byte port = A0;
byte motor = 8;
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 Tutorial [kembali]
Tidak ada komentar:
Posting Komentar