HELP with code please

Hi. I'm using an old Anet A8 main boardto run 1 possibly 2 motors for a project.

I'm trying to use as many old components of the printer as I can.

I aim to use the old end stops as switches. One will start the motor (nema17) and the other switch to stop. I need this to repeat untill the machine is turned off.

I'm great with the mechanical stuff but code is over my head.

Thanks!

Welcome to the Arduino forum. Interesting project, but can you please show us where your Arduino fits into the project?
While you are at it, can you explain how the old end stop switch will start the motor?
It's not mechanical, but, surely, you can show a block diagram of the project and identify all the pieces and how they are connected. And the power supplies for the project.

1 Like

Hi. Appoligies. Yes I'm looking for some help developing the code. Il post a few pictures of the components.

At the moment it's

1x nema17 motor
2 x limit switches - mechanical
Currently a Anet A8 main board but if I can't recycle this then il order an Arduino.

This will be used to control a spool winder. As it hits the filament hits the top switch it will stop and when it hits the bottom it would start. And continue like this.

Do you know which processor is on that board?
Is a 128 or maybe a 328?

Hi Jim. It's a mega 1284p

Pictures are irrelevant unless the specifications are written on the component.

You are going to need to install the MCUdude/Mighty core in order to program that IC

Then you can program it like any other Arduino using the example codes as good places to start

1 Like

Il chuck some switches and motors on the board and give it a go. I know I need to change the pin numbers compared to the Arduino.

Thanks for the help. Il have a look and see what problems I can cause :grin:

Managed to get the LED to blink on the board. It only worked when choosing the ANET A8 BOARD in board options.

My main issue now is working out the correct pins for the steppers. The pin outputs on marlin are pins

MOTOR_STEP_PIN = 22, 
MOTOR_DIRECTION_PIN = 23,
MOTOR_ENABLE_PIN = 14.

How do I work this into Arduino?.

Iv tried speedystepper but can't get anywhere at all. It all uploads but nothing happens.

Thank you

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.