Programming an Arduino Uno to operate an Adafruit Motor Sheild V2.3

Hello,

I am a complete Novice to programming arduino and I am struggling to understand the programming language.

I have bought myself the below listed items with intention of having them operate a set of 4 nanotec SC4118L1804-KPRO Stepper Motors from conventional G-Code.

List of items:
Arduino UNO
Adafruit Motor Sheild V2.3 (another is on order)
4x SC4118L1804-KPRO

I have read through the adafruit guide and have come up with the following so far:

//void setup() {
// put your setup code here, to run once:
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include //void setup() {
// put your setup code here, to run once:
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_StepperMotor *myMotor = AFMS.getStepper (200, 1);
setSpeed(uint16_t = 100)
step(uint16_t = 400, uint8_t = FORWARD, uint8_t = MICROSTEP)
}

My logic behind this was predominantly taken from the instructions provided by adafruit but again I am a complete novice. I understand that my motors are 3.15V 1.8A 2 Coil 4 Wire Stepper motors and they are therefore attatched to the M1 and M2 pins on the Motor Sheild. I copied the sketch files as instructed on the adafruit page and noticed immediately that the line reading #include "utility/Adafruit_PWMServoDriver.h"' is incorrect as the file name was in fact Adafruit_MS_PWMServoDriver.h hence the alteration there. I then set the motor values as instructed (1.8 degrees per step equates to 200 steps per revolution) meaning 200 as the steps per rev and 1 because I am using M1 and M2 as the motor connections. From there I got confused as to how it should go and just fiddled until the error messages stopped as much as possible. what else do I need to do/change to get to my goal of operating from G-Code?

Many thanks to anyone who can help me with this.

regards

mike

The libraries should have come with example code.

Stop right there until you know some more of the basics of C and C++

Work your way through the examples in the IDE and experiment with inputs and outputs and get a feel for the structure of a C/C++ program.

There are some obvious problems with the code posted, not least that you have #included some files twice. In fact most of it is nonsense. Forget about G-Code for now. Get one of the motors working at a set speed then change the speed and direction of that motor. Read this thread Stepper basics

When posting code here please Auto Format it in the IDE first then use code tags when posting it. Have you read read this before posting a programming question ?