Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need some help with the code for my project.

Chemdawgds

New Member
Hello everyone. I'm working on a project right now, but had to make a few changes. Some background information. I'm using an arduino uno, with 2 28byj-48 stepper motors and associated ULN2003 driver boards. There is a rotary encoder and an 8 segment LED display that shows the speed. Due to the steppers in factory form not having enough torque, I decided to do the modification to make them bipolar instead of unipolar. So now I'm using an adafruit motor shield V2 to drive the steppers in bipolar mode. WAY MORE TORQUE now.
So the issue. The program I have is for using the original 28byj-48 stepper and ULN2003 driver. I need to fix this program so that it uses the V2 motor shield instead. I want the same features with the rotary encoder and the LED display. So basically I'm just changing the drier board.
I have no idea how to fix the code to do this. Please help. I posted the original code.
 

Attachments

  • Astro_Motorized_Stepper_V2.ino
    5.7 KB · Views: 41

sagor1

Active Member
Have you tried the new shield with existing code? Your code does not have anything specific for stepper motors except the maximum speed and steps per revolution.
The code uses the default arduino stepper library. See if there is a different library for the new shield....
 

Chemdawgds

New Member
There is. It's the adafruit motor shield v2 library. I'm very green with Arduino code, so I'm not sure how to implement this.
 

Wp100

Well-Known Member
As you have seen the Adafruit stepper code is quiet different from your original code.

Jumping into code like that and changing one of its core functions is not going to be easy for someone new to Arduino, though not impossible.

Often its easier to write new code around the Adafruit stepper code, start by understanding how to control the motors with the Adafruit driver and their code examples, then try and follow how the Astro code works and see if you can make the Adafruit code do the same.

Just depends if you want to spend the time learning Arduino coding for future projects or this is just a one off thats not worth all that effort ? ( though it can be interesting and rewarding )
 

Latest threads

Top