![]() ![]() It keeps the speed but serial.print doesnt show anything happening in the serial monitor.Įnable is used on the easy driver too de-energize the coils if the stepper motor is in rest position. So now I for test used this piece of code and added the serial.print in this demo just to see if it keeps the stepper motor speed and a serial value is written. The reason I did not used the accelstepper lib was that I used a piece of sample code that was not refering to it. If I uncomment the line with serial print the stepper motor runs in a very very low speed. Serial.println(scale.read()/100) //raw loadcell data devided by 100 ![]() Serial.println (Position) // keeps score of the steps done to calulate the movement in 0.5 mm + or. PinMode(Analog3,INPUT) // set the A3 pin to inputĭistance = Distance + 1 // record this Step as part of a rotation where 900 is a quarter rotationĭistance = 0 // reset the Motorstep counter to 0 PinMode(Analog2,INPUT) // set the A2 pin to input Int Distance = 0 // Record the number of steps the motor has done ![]() Int Analog3 = 17 // Use analog port on shield for push button to control movement and Direction Int Analog2 = 16 // Use analog port on shield for push button to control movement and Direction I need the combination as I use the stepper to compress a spring and measure the force and the current position which need to be send to a PC application. Button currrently controls up and down movement of the stepper motor.Ĭode works but as soon as I uncomment a line related to serial.print it also stops to work correctly. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |