This is an older post about setting up a CNC Shield, but I have edited it since the title and description were misleading. The comments here are EXTREMELY HELPFUL for setting up a CNC shield v4 board. They include code for testing if your stepper motors are correctly connected, the pinout, and pin numbering for Arduino IDE.
The kit you should buy if you would like to follow this tutorial can be bought here: https://www.aliexpress.us/item/2251832035811475.html?spm=a2g0o.detail.pcDetailTopMoreOtherSeller.10.3fe9i0iWi0iW2v&gps-id=pcDetailTopMoreOtherSeller&scm=1007.40196.366991.0&scm_id=1007.40196.366991.0&scm-url=1007.40196.366991.0&pvid=5c83e78e-97fb-48de-a5c7-35db0da5b120&_t=gps-id:pcDetailTopMoreOtherSeller,scm-url:1007.40196.366991.0,pvid:5c83e78e-97fb-48de-a5c7-35db0da5b120,tpp_buckets:668%232846%238111%231996&pdp_ext_f=%7B%22order%22%3A%2210%22%2C%22eval%22%3A%221%22%2C%22sceneId%22%3A%2230050%22%7D&pdp_npi=4%40dis%21USD%2119.99%2119.99%21%21%2119.99%2119.99%21%402103010e17397411430922198e1202%2155305829959%21rec%21US%216242698492%21X&utparam-url=scene%3ApcDetailTopMoreOtherSeller%7Cquery_from%3A. This may be more expensive then the $2 "cloned" boards, but it is entirely worth it. The cloned boards have many problems that require cutting PCB and soldering to fix. To find out more about this, look up "Fix Cloned CNC Shield" and an instructable should show up. The expensive Keyestudio kits work right out of the box, and come with 3 stepper drivers. If you would like more help, please ask in the thread.
I have it working (in breadboard mode) with a CNC V4. Pins for my V4 are in the image below.
Micro steps will depend on jumpers on the V4. Had an issue with the steppers and how they are wired with the flat cable that came with them. Had to swap some pins. Easy to check what pairs to use by shorting stepper pins together to find the ones that cause the stepper to 'turn hard' by hand. direction can be changed by swapping the connector on the board around.
No on GRBL. You will overwrite what might be on the nano.
the code above has the switch connected to A3 (and ground) I had a 3 wire patch cable connected to the switch and use 2 of the connectors to connect to the V4.
be aware V4 boards are not all the same. I ended up with this one
Free Shipping! New! Keyestudio Cnc Shield V4 +3pcs A4988 Driver+ Nano Ch340 For Arduino Cnc - Integrated Circuits - AliExpress
I'll get some pics later.
I had slightly different pin requirements, I'm using the v4 nano (and a v3 uno), except it's the HW-702 v0.0.0, and in addition to fixing the microstep jumpers to 5V instead of ground, I had to alter the step/direction pins to accommodate the differences according to this info: https://www.instructables.com/Fix-Cloned-Arduino-NANO-CNC-Shield/#:~:text=Lines%2047%2C48%20%26%2049-,need%20replacing%20with,-%3A
My changes are here (also includes optional serial prints for display-less diagnostics)
https://github.com/3DChameleon/3DChameleonMk4/compare/main...tyeth:3DChameleonMk4:nano-cnc-shield