Cnc shield without Grbl

Hi everyone, I'm creating a little project using arduino uno with the cnc shield and I'm not using grbl library, I'm just letting the stepper motor run freely but I need to use a botton, if I push it the motor stop and when I stop pushing it the stepper will continue running, Now I just want to know if I can put for example D9 as a digital reader to do that, because I don't know if it can cause any damage to the shield or to the driver since the shield is using that digital pin.
You can see the code if you want

#define STEP 4      // pin STEP de A4988 a pin 4
#define DIR 7     // pin DIR de A4988 a pin 5
#define ENBL 8     // pin DIR de A4988 a pin 8
int retardo = 1000;
void setup() {
  // put your setup code here, to run once:
pinMode(STEP, OUTPUT);  // pin 4 como salida
pinMode(DIR, OUTPUT);   // pin 5 como salida
pinMode(ENBL, OUTPUT);   // pin 5 como salida
}

void loop() {
giro(STEP,DIR,ENBL);  // put your main code here, to run repeatedly:

}
void giro(int paso_,int dire_,int habi_) {
   digitalWrite(habi_, LOW);  // Habilita el Driver
   digitalWrite(dire_, LOW);   // direccion de giro 1
  // for(int i=0;i<tiempo;i++){  // da  pasos por un tiempo  
    digitalWrite(paso_, HIGH);      
    delayMicroseconds(retardo);          
    digitalWrite(paso_, LOW);       
    delayMicroseconds(retardo); 
   }
   

Thank you

Use the HOLD and RESUME buttons.
They will need to be implemented in your code but it makes sense to use the pins as intended.

IIRC they use A1 and A2
Preferably you need a NON BLOCKING method so you don't affect anything else.

Are the pins you're considering attached to one of the drivers? D9 is a limit switch for X, so it should be clear:

I think so, because, based on schematic, this pin is wired only to a connect no CNC Shield.

" Ref: Using cnc shield v3 directly with arduino ide - #3 by aaa76543

Ref:
" Arduino-CNC-Shield-Schematics | Protoneer.co.nz

1 Like

thank you

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