Setting PWM Motor DC Gearmotor menggunakan Arduino Dueminalove ATMega168 dan Driver Motor L298
Peralatan yang digunakan antara lain :
-
Bracket DC Gearmotor 42D for KR13042
Rp49.900 Add to cart -
KR03021 Arduino MEGA328 w/ Driver Motor
Rp650.000 Add to cart -
KR03001 Arduino MEGA168 w/Driver Motor
Rp250.000 Add to cart -
2 Ampere – L298P Driver Motor Shield for Arduino UNO / Mega KR09042
Rp77.000 Add to cart -
XL4015
Rp77.000 Add to cart -
Power Supply 220Volt AC to 12Volt 10A Viewmagic
Rp160.000 Add to cart -
Sale!
KR13042 12VDC Motor Power Heavy Duty 322rpm 9Kg.cm
Original price was: Rp299.000.Rp287.000Current price is: Rp287.000. Add to cart -
Sale!
KR09037 DoubleShoot L298N Motor Driver (2A 5V~35V DC)
Original price was: Rp128.000.Rp122.880Current price is: Rp122.880. Add to cart
Berikut Script Arduino yang digunakan :
int E2= 6; //the pin to control motor’s speed (0-255) int M2= 7; //the pin to control direction CW/ CCW void setup() { } void loop() { analogWrite(E2, 90); // nilai PWM Motor (0-255) digitalWrite(M2, 1); // motor M2 Putar CCW/ berlawananan jarum jam delay(5000); analogWrite(E2, 0); // nilai PWM Motor Berhenti (0) digitalWrite(M2, 1); // motor M2 delay(5000); analogWrite(E2, 90); // nilai PWM Motor (0-255) digitalWrite(M2, 0); // motor M2 Putar CW/ searah jarum jam delay(5000); analogWrite(E2, 0); // nilai PWM Motor Berhenti (0) digitalWrite(M2, 0); // motor M2 delay(5000); }
Post Comment
You must be logged in to post a comment.