Arini aku mencuba produk baru, ARDUINO PRO MINI untuk projek CNC aku. Guess What!!!???, working like charm!!!... Evidence is here...White man say " A picture represent one thousand words ", But i say " A video represent a MILLION words ". So, let have a look guys... Sebelum bukak video nih, aku nak warning kat korang (PLEASE TURN DOWN VOLUME, takut2 tersakit plak telinge bunyi bising)
Ok yang nih abang Nasrul request... so ini hasilnya
So, lepas nih ade lagi projek yang nak buat tapi tak lukis dah. Terus mesin, ehehe... nak buat gear tapi pening dengan equation...ade sape leh tolong???
Salam,OK, nih ade tutorial acannne nak control stepper motor secare manual... Bile abam zairi suruh tunjuk skit. so sini video die abam zairi
Untuk control stepper motor ni kene ade
Stepper motor (mane2 tak kisah tapi yang aku jual memang bole masuk)
Arduino board (Mega, UNO, Mini @ Nano.. yang lain maybe boleh)
Easy Driver (aku ade jual gak)
Breadboard/ Circuit board pon boleh
Jumper wire
Tactile switch, yang switch aku tekan tu la ( ade jual jugak, tgk store aku)
Dan ini codenya...
//Basic code by MSIDRIS for Manual control stepper motor
// Using Easy driver and Arduino uno..
int delays;
const int ManPosY = 4; //Manual input from switch to control + direction
const int ManNegY = 5; //Manual input from switch to control - direction
const int DirY = 8;
const int LocY = 9;
float buttonPushCounterPosy,buttonPushCounterNegy = 0;// counter for the number of button presses
int buttonStatex = 0;
int buttonStatePosy, buttonStateNegy,buttonStatePosx = 0; // current state of the button
int lastButtonStatePosy,lastButtonStateNegy = 0;
void setup() {
Serial.begin(9600);
pinMode(ManPosY, INPUT); //override y +ve
pinMode(ManNegY, INPUT); //override y -ve
pinMode(DirY, OUTPUT);
pinMode(LocY, OUTPUT);
digitalWrite(DirY, LOW);
digitalWrite(LocY, LOW);
}
void loop() {
buttonStatePosy = digitalRead(ManPosY);
buttonStateNegy = digitalRead(ManNegY);
if ((digitalRead(ManPosY)==HIGH)){
buttonPushCounterPosy++;
delay(200);
while(round(buttonPushCounterPosy/2-round(buttonPushCounterPosy/2))!=0){
if (digitalRead(ManPosY)==HIGH){buttonPushCounterPosy++;}
delays=100;
digitalWrite(DirY,LOW) ;
digitalWrite(LocY, HIGH);delayMicroseconds(delays);
digitalWrite(LocY, LOW);delayMicroseconds(delays);
}
delay(200);}
if ((digitalRead(ManNegY)==HIGH)){
buttonPushCounterNegy++;
delay(200);
while(round(buttonPushCounterNegy/2-round(buttonPushCounterNegy/2))!=0){
if (digitalRead(ManNegY)==HIGH){buttonPushCounterNegy++;}
delays=100;
digitalWrite(DirY,HIGH) ;
digitalWrite(LocY, HIGH);delayMicroseconds(delays);
digitalWrite(LocY, LOW);delayMicroseconds(delays);
}
delay(200);}
}
tekan sekali untuk jalan dan tekan sekali lagi untuk stop...
Ahah... lame dah tak update blog... Bisnes makin rancak pastu bizi sangat ngan arduino so arini nak update pasal keje aku iaitu projek CNC.... Let the Video tell you all...