X-Git-Url: http://git.piffa.net/web?a=blobdiff_plain;ds=sidebyside;f=motors%2Fstepper%2Fstep_8_phase_raw%2Fstep_8_phase_raw.ino;fp=motors%2Fstepper%2Fstep_8_phase_raw%2Fstep_8_phase_raw.ino;h=0000000000000000000000000000000000000000;hb=daadffcffaf4c0618a6008c7582ceb92aaae64ed;hp=3f1c85c92ab2837e204273aac5caefc184b0dba1;hpb=bed0e6592e7e7fc144a3787ce0dcb20556aff7db;p=sketchbook_andrea diff --git a/motors/stepper/step_8_phase_raw/step_8_phase_raw.ino b/motors/stepper/step_8_phase_raw/step_8_phase_raw.ino deleted file mode 100644 index 3f1c85c..0000000 --- a/motors/stepper/step_8_phase_raw/step_8_phase_raw.ino +++ /dev/null @@ -1,131 +0,0 @@ - - -/* - BYJ48 Stepper motor code - Connect : - IN1 >> D8 - IN2 >> D9 - IN3 >> D10 - IN4 >> D11 - VCC ... 5V Prefer to use external 5V Source - Gnd - written By :Mohannad Rawashdeh - http://www.instructables.com/member/Mohannad+Rawashdeh/ - 28/9/2013 - */ - -#define IN1 8 -#define IN2 9 -#define IN3 10 -#define IN4 11 -int Steps = 0; -boolean Direction = true;// gre -unsigned long last_time; -unsigned long currentMillis ; -int steps_left=4095; -long time; -void setup() -{ - Serial.begin(115200); - pinMode(IN1, OUTPUT); - pinMode(IN2, OUTPUT); - pinMode(IN3, OUTPUT); - pinMode(IN4, OUTPUT); - // delay(1000); - -} -void loop() -{ - while(steps_left>0){ - currentMillis = micros(); - if(currentMillis-last_time>=1000){ - stepper(1); - time=time+micros()-last_time; - last_time=micros(); - steps_left--; - } - } - Serial.println(time); - Serial.println("Wait...!"); - delay(2000); - Direction=!Direction; - steps_left=4095; -} - -void stepper(int xw){ - for (int x=0;x7){ - Steps=0; - } - if(Steps<0){ - Steps=7; - } -} - -