Houssam Mahmoud
Houssam Mahmoud
  • 30
  • 3 770
Steps to Use the Flex Tool for Bending
Choose the Flex Type:
SolidWorks provides multiple flex types, including:
Bending
Twisting
Tapering
Stretching
For bending, ensure "Bending" is selected in the Flex options.
Trim Planes: Properly adjust the trim planes to localize the bending effect. This ensures you deform only the intended section of the model.
Angle Adjustments: Start with small angle adjustments to fine-tune the effect before applying larger deformations.
Material Impact: Flex doesn’t simulate material stresses or real-world bending forces-it’s purely a geometric operation.
Переглядів: 53

Відео

Use Convert Entities in a 3D Sketch SolidWorks
Переглядів 110Місяць тому
Steps to Use Convert Entities in a 3D Sketch Start a 3D Sketch: From the toolbar, select 3D Sketch. This enables the creation of 3D geometry, and axes (X, Y, Z) will appear. Select the Geometry to Convert: Choose edges, faces, or other sketch entities from existing parts, assemblies, or features in the 3D environment. Activate Convert Entities: Click on Convert Entities. SolidWorks will project...
rectangular inductor in SolidWorks using an intersection curve
Переглядів 872 місяці тому
Define the Coil Path (Helix/Spiral Feature) Create the Inductor Cross-Section using intersection curve Sweep the Cross-Section Along the Path
circular inductor in SolidWorks using the Intersection tool
Переглядів 932 місяці тому
Define the Coil Path (Helix/Spiral Feature) Create the Inductor Cross-Section Sweep the Cross-Section Along the Path
Intersection Curve tool in SolidWorks and Twist in Sweep
Переглядів 792 місяці тому
Intersection: Generating precise curves for lofts in automobile design. Sweep: Creating pipes, wires, or custom profiles in architectural modeling. Twist in Sweep: Designing helical gears, springs, or artistic components.
In SolidWorks, Intersection Curve, Loft, and Extrude surfaces
Переглядів 382 місяці тому
Intersection Curve: Select two or more surfaces or bodies that intersect. The software automatically generates a curve along the line where these surfaces meet. This curve can then be used for further modeling, such as creating a cut, a new profile, or guiding a loft or sweep. Loft: Select two or more sketch profiles (could be circles, arcs, splines, etc.) that represent the start and end secti...
In SolidWorks, creating a snap hook and a snap hook groove
Переглядів 1744 місяці тому
Design for Manufacturing: Ensure that the hook has sufficient material to avoid breaking during operation. Consider the material's flexibility and strength when designing. Clearance: Make sure there is a slight clearance between the hook and the groove to allow for easy snapping action. The clearance should be enough to accommodate any manufacturing tolerances. Drafts: Use drafts on both the ho...
How to Create a Mounting Boss for plastic box in SolidWorks
Переглядів 844 місяці тому
Tips for Using Mounting Bosses Draft Angles: Always include draft angles when designing bosses for injection-molded parts to allow for easy release from the mold. Rib Reinforcement: Use ribs to prevent bosses from shearing off under load, especially in high-stress applications. Boss Placement: Consider the overall layout and load distribution in your design to place bosses in locations where th...
Cable Lug in SolidWorks, Flex Tools and bend
Переглядів 784 місяці тому
you'll explore the Flex tool, which allows you to bend or twist the model in unique ways, adding a professional touch to your design.
Wire with Cable Lug in SolidWorks Using Spiral, and Swept , configurations
Переглядів 814 місяці тому
This advanced SolidWorks tutorial will teach you to design a detailed 3D model of a copper wire connected to a cable lug. You'll begin by creating the wire using the Helix and Spiral command, employing the Swept Boss/Base feature to shape the wire. and adding two configurations Using linear and Circular Sketch Patterns
Updated Code with Soft Start and End (Acceleration and Deceleration) Arduino Stepper motor
Переглядів 344 місяці тому
modifying the code to include separate functions that check for serial input and process commands add a soft start and end movement, meaning the stepper motor gradually accelerates to the maximum speed and then gradually decelerates to a stop تعديل الكود ليتحول الى مجموعة من التوابع المنفصلة التي تتحقق من الإدخال السيريال .... أضافة حركة بداية ونهاية ناعمة، مما يعني أن المحرك الخطوي يتسارع تدري...
joystick drive two stepper motors convert the code to classes p9
Переглядів 405 місяців тому
joystick drive two stepper motors and create a class and oop in Arduino from the code قيادة محركين خطوين عن طريق جوستك و تحويل الكود اللا كلاسيس صفوف
potentiometer with stepper motor and tb6600 as a joystick p8
Переглядів 255 місяців тому
potentiometer to drive a stepper motor increase and decrease the speed زيادة سرعة المحرك الخطوي عن طريق جوستيك على مبدا المقاومة المتغيرة موصولة على انالوك
Hole Wizard, linear pattern in SolidWorks
Переглядів 1245 місяців тому
Hole Wizard, linear pattern رسم ميكانزم تحويل الحركة الدورانية الى خطية اذا لم يكن هناك حاجة الى الرسم التفصيلي خاصة للاجزاء التي يتم شراؤها من المتجر لتجميعها في المنتج الاخير .. يكفي رسم الشكل الخارجي الذي يشغل مساحة العمل و اضافة الى الثقوب (بدقة ) و المناطق المهمة اللازمة للتجميع مع القطع الاخرى
Advanced assembly, flixable subassembly
Переглядів 375 місяців тому
Advanced assembly, flixable subassembly
create a class and oop to drive two motors in the same time by arduino p7
Переглядів 175 місяців тому
create a class and oop to drive two motors in the same time by arduino p7
Millis() function to run twostepper at the same time Arduino mega p6
Переглядів 375 місяців тому
Millis() function to run twostepper at the same time Arduino mega p6
Plastic box used for injection mold or epoxy ,draft and shell
Переглядів 345 місяців тому
Plastic box used for injection mold or epoxy ,draft and shell
class and oop for arduino and stepper motor p.5
Переглядів 605 місяців тому
class and oop for arduino and stepper motor p.5
Serial monitor and stepper motor arduino mega p4
Переглядів 425 місяців тому
Serial monitor and stepper motor arduino mega p4
Symbols in Solidworks: MOD DIAM
Переглядів 445 місяців тому
Symbols in Solidworks: MOD DIAM
Serial monitor and stepper motor p3
Переглядів 465 місяців тому
Serial monitor and stepper motor p3
insert part and intersecting and hatching
Переглядів 485 місяців тому
insert part and intersecting and hatching
modify the stepper motor code in arduino -p2
Переглядів 585 місяців тому
modify the stepper motor code in arduino -p2
first code to drive a stepper motor with TB6600 -p1
Переглядів 665 місяців тому
first code to drive a stepper motor with TB6600 -p1
Cavity and Hatching in Solidworks
Переглядів 925 місяців тому
Cavity and Hatching in Solidworks
Robot Arm
Переглядів 545 місяців тому
Robot Arm

КОМЕНТАРІ

  • @hussien3152
    @hussien3152 3 місяці тому

    كيف احصل على كورس solidwork electrical

    • @houssammahmoud2127
      @houssammahmoud2127 3 місяці тому

      ua-cam.com/video/XSydDiDJ2Oc/v-deo.html&ab_channel=TriMechGroup

    • @houssammahmoud2127
      @houssammahmoud2127 3 місяці тому

      ua-cam.com/video/YrfYL-W6BGA/v-deo.html&ab_channel=GoEngineer

    • @houssammahmoud2127
      @houssammahmoud2127 3 місяці тому

      ua-cam.com/video/EH7VKTdD9GM/v-deo.html&ab_channel=Intercad

  • @cadcaetutorial2039
    @cadcaetutorial2039 4 місяці тому

    So perfect sir

  • @cadcaetutorial2039
    @cadcaetutorial2039 4 місяці тому

    Amazing sir

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #define STEP_PIN 12 #define DIR_PIN 11 #define ENABLE_PIN 10 const int maxSpeed = 1000; // Maximum speed (steps per second) const int maxAcceleration = 500; // Maximum acceleration (steps per second^2) void setup() { pinMode(STEP_PIN, OUTPUT); pinMode(DIR_PIN, OUTPUT); pinMode(ENABLE_PIN, OUTPUT); digitalWrite(ENABLE_PIN, LOW); // Enable the driver Serial.begin(9600); Serial.println("Enter command: 'm [steps]' to move forward, 'p [steps]' to move backward."); } // Function to move the stepper motor with soft start and stop (acceleration and deceleration) void stepperMove(int steps, bool direction, int maxSpeed, int maxAcceleration) { digitalWrite(DIR_PIN, direction); // Set direction float currentSpeed = 0; // Start at 0 speed int speedDelay; int accelerationSteps = (maxSpeed * maxSpeed) / (2 * maxAcceleration); // Number of steps needed for acceleration/deceleration for (int i = 0; i < steps; i++) { // Acceleration phase if (i < accelerationSteps && currentSpeed < maxSpeed) { currentSpeed += (float)maxAcceleration / maxSpeed; if (currentSpeed > maxSpeed) currentSpeed = maxSpeed; } // Deceleration phase if (i >= steps - accelerationSteps && currentSpeed > 0) { currentSpeed -= (float)maxAcceleration / maxSpeed; if (currentSpeed < 0) currentSpeed = 0; } speedDelay = 1000000 / currentSpeed; // Convert speed to delay in microseconds digitalWrite(STEP_PIN, HIGH); // Step motor delayMicroseconds(speedDelay); // Control speed digitalWrite(STEP_PIN, LOW); delayMicroseconds(speedDelay); // Control speed } } // Function to check serial input and execute commands void checkSerial() { if (Serial.available() > 0) { String input = Serial.readStringUntil(' '); // Read the input until a newline character input.trim(); // Remove any leading or trailing whitespace char command = input.charAt(0); // First character is the command ('m' or 'p') int steps = input.substring(2).toInt(); // Extract the steps from the input string if (steps > 0) { if (command == 'm') { Serial.print("Moving forward "); Serial.print(steps); Serial.println(" steps..."); stepperMove(steps, HIGH, maxSpeed, maxAcceleration); } else if (command == 'p') { Serial.print("Moving backward "); Serial.print(steps); Serial.println(" steps..."); stepperMove(steps, LOW, maxSpeed, maxAcceleration); } else { Serial.println("Invalid command. Use 'm' or 'p' followed by a number of steps."); } } else { Serial.println("Invalid number of steps."); } } } void loop() { checkSerial(); // Check for serial input and execute commands }

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #ifndef STEPPERMOTOR_H #define STEPPERMOTOR_H #include <Arduino.h> class StepperMotor { public: StepperMotor(int stepPin, int dirPin, int enablePin, int potPin); void initialize(); void determineDirection(); void moveMotor(); private: int stepPin; int dirPin; int enablePin; int potPin; int potValue; int stepDelay; int direction; }; #endif

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #include "StepperMotor.h" StepperMotor::StepperMotor(int stepPin, int dirPin, int enablePin, int potPin) { this->stepPin = stepPin; this->dirPin = dirPin; this->enablePin = enablePin; this->potPin = potPin; this->potValue = 0; this->stepDelay = 0; this->direction = 1; } void StepperMotor::initialize() { pinMode(stepPin, OUTPUT); pinMode(dirPin, OUTPUT); pinMode(enablePin, OUTPUT); digitalWrite(enablePin, LOW); // LOW to enable, HIGH to disable } void StepperMotor::determineDirection() { potValue = analogRead(potPin); // Read the potentiometer value (0-1023) if (potValue < 500) { direction = 1; // Forward stepDelay = map(potValue, 0, 500, 500, 1500); // Map to a delay range in microseconds } else if (potValue > 550) { direction = 0; // Backward stepDelay = map(potValue, 550, 1023, 1500, 500); // Map to a delay range in microseconds } else { stepDelay = 0; // Stop the motor if the potentiometer is at 512 } digitalWrite(dirPin, direction); } void StepperMotor::moveMotor() { if (stepDelay > 0) { // Only pulse the step pin if the speed is not zero digitalWrite(stepPin, HIGH); delayMicroseconds(stepDelay); // Control the speed with delay digitalWrite(stepPin, LOW); delayMicroseconds(stepDelay); // Control the speed with delay } }

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    // Pin assignments #include "StepperMotor.h" StepperMotor motor1(9, 8, 7, A5); StepperMotor motor2(12, 11, 10, A4); void setup() { // put your setup code here, to run once: motor1.initialize(); motor2.initialize(); } void loop() { motor1.determineDirection(); motor1.moveMotor(); motor2.determineDirection(); motor2.moveMotor();

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    // Pin assignments const int stepPin = 9; // Pin for PUL+ (Pulse Positive) const int dirPin = 8; // Pin for DIR+ (Direction Positive) const int enablePin = 7; // Optional: Pin for EN+ (Enable Positive) const int potPin = A5; // Analog pin for the potentiometer int potValue = 0; // Variable to store the potentiometer value int stepDelay = 0; // Delay between steps (controls speed) int direction = 1; // Variable to store the direction (1 for forward, 0 for backward) void setup() { Serial.begin(9600); pinMode(stepPin, OUTPUT); pinMode(dirPin, OUTPUT); pinMode(enablePin, OUTPUT); enableDriver(); // Enable the driver } void loop() { readPotentiometer(); determineDirection(); moveMotor(); } void enableDriver() { // Enable the driver (optional) digitalWrite(enablePin, LOW); // LOW to enable, HIGH to disable } void readPotentiometer() { // Read the potentiometer value (0-1023) potValue = analogRead(potPin); } void determineDirection() { // Determine the direction based on the potentiometer value if (potValue < 450) { direction = 1; // Forward stepDelay = map(potValue, 0, 450, 500, 1500); // Map to a delay range in microseconds } else if (potValue > 550) { direction = 0; // Backward stepDelay = map(potValue, 550, 1023, 1500, 500); // Map to a delay range in microseconds } else { stepDelay = 0; // Stop the motor if the potentiometer is centered } // Set the direction digitalWrite(dirPin, direction); } void moveMotor() { // Move the motor based on the calculated delay if (stepDelay > 0) { // Only pulse the step pin if the speed is not zero // Pulse the step pin to move the motor digitalWrite(stepPin, HIGH); delayMicroseconds(stepDelay); // Control the speed with delay digitalWrite(stepPin, LOW); delayMicroseconds(stepDelay); // Control the speed with delay } }

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    // Pin assignments const int stepPin = 9; // Pin for PUL+ (Pulse Positive) const int dirPin = 8; // Pin for DIR+ (Direction Positive) const int enablePin = 7; // Optional: Pin for EN+ (Enable Positive) const int potPin = A5; // Analog pin for the potentiometer int potValue = 0; // Variable to store the potentiometer value int stepDelay = 0; // Delay between steps (controls speed) int direction = 1; // Variable to store the direction (1 for forward, 0 for backward) void setup() { Serial.begin(9600); pinMode(stepPin, OUTPUT); pinMode(dirPin, OUTPUT); pinMode(enablePin, OUTPUT); // Enable the driver (optional) digitalWrite(enablePin, LOW); // LOW to enable, HIGH to disable } void loop() { potValue = analogRead(potPin); // Read the potentiometer value (0-1023) // Determine the direction based on the potentiometer value if (potValue < 450) { direction = 1; // Forward stepDelay = map(potValue, 0, 450, 500, 1500); // Map to a delay range in microseconds } else if (potValue > 550) { direction = 0; // Backward stepDelay = map(potValue, 550, 1023, 1500, 500); // Map to a delay range in microseconds } else { stepDelay = 0; // Stop the motor if the potentiometer is at 512 } // Set the direction digitalWrite(dirPin, direction); if (stepDelay > 0) { // Only pulse the step pin if the speed is not zero // Pulse the step pin to move the motor digitalWrite(stepPin, HIGH); delayMicroseconds(stepDelay); // Control the speed with delay digitalWrite(stepPin, LOW); delayMicroseconds(stepDelay); // Control the speed with delay } }

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #include "MotorControl.h" // Define the connection pins for Motor 1 and Motor 2 MotorControl motor1(12, 11, 10, 200, 100); // stepPin, dirPin, enaPin, interval, stepsPerRevolution MotorControl motor2(9, 8, 7, 50, 400); // stepPin, dirPin, enaPin, interval, stepsPerRevolution void setup() { motor1.setup(); motor2.setup(); } void loop() { motor1.update(); motor2.update(); }

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #include "MotorControl.h" //MotorControl::MotorControl(int stepPin, int dirPin, int enaPin, long interval,int stepsPerRevolution) // : _stepPin(stepPin), _dirPin(dirPin), _enaPin(enaPin), _interval(interval),_stepsPerRevolution(stepsPerRevolution), _previousMillis(0), _stepCount(0) {} MotorControl::MotorControl(int stepPin, int dirPin, int enaPin, long interval, int stepsPerRevolution) { this->_stepPin = stepPin; this->_dirPin = dirPin; this->_enaPin = enaPin; this->_interval = interval; this->_stepsPerRevolution = stepsPerRevolution; this->_previousMillis = 0; this->_stepCount = 0; } void MotorControl::setup() { pinMode(_stepPin, OUTPUT); pinMode(_dirPin, OUTPUT); pinMode(_enaPin, OUTPUT); } void MotorControl::runMotor() { if (_stepCount < _stepsPerRevolution) { digitalWrite(_stepPin, HIGH); delayMicroseconds(50); // Short pulse to trigger the step digitalWrite(_stepPin, LOW); _stepCount++; } } void MotorControl::update() { unsigned long currentMillis = millis(); if (currentMillis - _previousMillis >= _interval) { _previousMillis = currentMillis; runMotor(); } }

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #ifndef MOTORCONTROL_H #define MOTORCONTROL_H #include <Arduino.h> class MotorControl { public: MotorControl(int stepPin, int dirPin, int enaPin, long interval, int stepsPerRevolution); void setup(); void runMotor(); void update(); private: int _stepPin; int _dirPin; int _enaPin; long _interval; int _stepsPerRevolution; unsigned long _previousMillis; int _stepCount; }; #endif

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    // Define the connection pins for Motor 1: #define stepPin1 12 //pulse #define dirPin1 11 //dir #define enaPin1 10 //ena // Define the connection pins for Motor 2: #define stepPin2 9 //pulse #define dirPin2 8 //dir #define enaPin2 7 //ena // Variables to track the timing of steps unsigned long previousMillisMotor1 = 0; unsigned long previousMillisMotor2 = 0; const long intervalMotor1 = 100; // Interval at which to step motor 1 (speed)(microseconds) const long intervalMotor2 = 50; // Interval at which to step motor 2 (speed)(microseconds) //------- void setup() { // put your setup code here, to run once: pinMode(stepPin1,OUTPUT);//Pul pinMode(dirPin1,OUTPUT);//Dir pinMode(enaPin1,OUTPUT); pinMode(stepPin2,OUTPUT);//Pul pinMode(dirPin2,OUTPUT);//Dir pinMode(enaPin2,OUTPUT); } //------- void loop() { unsigned long currentMillis = millis(); // Motor 1 if (currentMillis - previousMillisMotor1 >= intervalMotor1) { previousMillisMotor1 = currentMillis; runMotor1(100); } // Motor 2 if (currentMillis - previousMillisMotor2 >= intervalMotor2) { previousMillisMotor2 = currentMillis; runMotor2(100); } } //------- // Function to step Motor 1 void runMotor1(int stepsPerRevolution) { static int stepCount = 0; if (stepCount < stepsPerRevolution) { digitalWrite(stepPin1, HIGH); delayMicroseconds(50); // Short pulse to trigger the step digitalWrite(stepPin1, LOW); stepCount++; } } // Function to step Motor 2 void runMotor2(int stepsPerRevolution ) { static int stepCount = 0; if (stepCount < stepsPerRevolution) { digitalWrite(stepPin2, HIGH); delayMicroseconds(50); // Short pulse to trigger the step digitalWrite(stepPin2, LOW); stepCount++; } }

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #ifndef mysteppers_H #define mysteppers_H #include<Arduino.h> class mysteppers { private: int stepPin;//or _stepPin for example int dirPin; int enaPin; unsigned long step_delay; long number_of_steps; public: mysteppers( int stepPin, int dirPin,int enaPin); void forward (long number_of_steps, unsigned long step_delay); void reverse (long number_of_steps, unsigned long step_delay); }; #endif

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #include "mysteppers.h" #include<Arduino.h> mysteppers::mysteppers(int stepPin, int dirPin,int enaPin){ this->stepPin = stepPin;//or _stepPin = stepPin this->dirPin = dirPin; this->enaPin = enaPin; pinMode(this->stepPin, OUTPUT); pinMode(this->dirPin, OUTPUT); pinMode(this->enaPin, OUTPUT); } void mysteppers::forward (long number_of_steps, unsigned long step_delay) { this->number_of_steps = number_of_steps; // total number of steps for this motor this-> step_delay = step_delay; int i; digitalWrite(enaPin,LOW); digitalWrite(dirPin,HIGH); for(i=0;i<number_of_steps;i++){ digitalWrite(stepPin,!digitalRead(stepPin)); delay(step_delay); } digitalWrite(enaPin,HIGH); } void mysteppers::reverse (long number_of_steps, unsigned long step_delay) { this->number_of_steps = number_of_steps; // total number of steps for this motor this-> step_delay = step_delay; int i; digitalWrite(enaPin,LOW); digitalWrite(dirPin,LOW); for(i=0;i<number_of_steps;i++){ digitalWrite(stepPin,!digitalRead(stepPin)); delay(step_delay); } digitalWrite(enaPin,HIGH); }

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #include "mysteppers.h" mysteppers stepper1(12, 11, 10); //pul+ , dir+ , ena+ mysteppers stepper2(9, 8, 7); //pul+ , dir+ , ena+ long Steps = 0; //Number of steps long Speed = 0; // milli second char command; //------- void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial.println("enter a command 'f'forward, 'r' reverse, number of steps and speed f 200 10" ); while(Serial.available()==0){} // if there is no serial do not do any command } //------- void loop() { // put your main code here, to run repeatedly: receiveFromSerial(); } //------- void receiveFromSerial(){ if (Serial.available() > 0) { command = Serial.read(); // read the command from the serial switch (command) { case 'f': Steps = Serial.parseFloat(); // take the value of steps from the serial Speed = Serial.parseFloat();// take the value of speed from serial Serial.println("CW."); stepper1.forward(Steps,Speed); // call the function from the class stepper2.forward(Steps,Speed); break; case 'r': Steps = Serial.parseFloat(); Speed = Serial.parseFloat(); Serial.println("CCW."); stepper1.reverse(Steps,Speed); break; default: // statements break; } } }

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #define stepPin 12 //pulse #define dirPin 11 //dir #define enaPin 10 //ena long Steps = 0; //Number of steps long Speed = 0; // milli second char command; //------- void setup() { // put your setup code here, to run once: pinMode(stepPin,OUTPUT);//Pul pinMode(dirPin,OUTPUT);//Dir pinMode(enaPin,OUTPUT); Serial.begin(9600); Serial.println("enter a number between 1 to 10000"); while(Serial.available()==0){} } //------- void loop() { // put your main code here, to run repeatedly: receiveFromSerial(); } //------- void receiveFromSerial(){ if (Serial.available() > 0) { command = Serial.read(); switch (command) { case 'a': Steps=Serial.parseInt(); Speed=Serial.parseInt(); Serial.println("CW."); forward(Steps,Speed); break; case 'b': Steps=Serial.parseInt(); Speed=Serial.parseInt(); Serial.println("CCW."); reverse(Steps,Speed); break; default: // statements break; } } } void forward (float steps, float dly){ int i; digitalWrite(enaPin,LOW); digitalWrite(dirPin,HIGH); for(i=0;i<steps;i++){ digitalWrite(stepPin,!digitalRead(stepPin)); delay(dly); } digitalWrite(enaPin,HIGH); } //------- void reverse (float steps, float dly){ int i; digitalWrite(enaPin,LOW); digitalWrite(dirPin,LOW); for(i=0;i<steps;i++){ digitalWrite(stepPin,LOW); digitalWrite(stepPin,HIGH); delay(dly); } digitalWrite(enaPin,HIGH); }

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    system options, file locations. symbols library, delete the path and add. C-ProgramData. (hidden files ) Solidworks to lang.

  • @houssammahmoud2127
    @houssammahmoud2127 5 місяців тому

    #define stepPin 12 //pulse #define dirPin 11 //dir #define enaPin 10 //ena int dly=10; //------- void setup() { // put your setup code here, to run once: pinMode(stepPin,OUTPUT);//Pul pinMode(dirPin,OUTPUT);//Dir pinMode(enaPin,OUTPUT); Serial.begin(9600); Serial.println("enter a number between 1 to 10000"); while(Serial.available()==0){} } //------- void loop() { // put your main code here, to run repeatedly: if (Serial.available() > 0) { int Steps=Serial.parseInt(); int inByte = Serial.read(); if(inByte=='a') { Serial.println(Steps); Serial.println("a"); forward(Steps); } else if (inByte=='b'){ Serial.println(Steps); Serial.println("b"); reverse(Steps); } } } //------- void forward (int steps){ int i; digitalWrite(enaPin,LOW); digitalWrite(dirPin,HIGH); for(i=0;i<steps;i++){ digitalWrite(stepPin,!digitalRead(stepPin)); delay(dly); } digitalWrite(enaPin,HIGH); } //------- void reverse (int steps){ int i; digitalWrite(enaPin,LOW); digitalWrite(dirPin,LOW); for(i=0;i<steps;i++){ digitalWrite(stepPin,LOW); digitalWrite(stepPin,HIGH); delay(dly); } digitalWrite(enaPin,HIGH); }