Tugas Pendahuluan Modul 2 Mikro
Kondisi
Mengatur kecepatan putar motor DC dengan kondisi potensio meter 0%
Hardware
byte pot = A0;byte motor = 9;int nilai;int output;void setup() {pinMode(motor, OUTPUT);Serial.begin(9600);}void loop() {nilai = analogRead(pot);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(100);}
Video Simulasi
Link Download
Tidak ada komentar:
Posting Komentar