//librerias
#include <Stepper.h>
int led=12;
int led1=11;
int led2=10;
// Motores Paso a Paso
const int motorX = 140; //(M8=>Paso:1,43mm; 360/1,43=>1mm=252º; 252ºpormm/0,9ºpor paso=280 Pasos por 1mm
const int motorY = 140; //(M8=>Paso:1,43mm; 360/1,43=>1mm=252º; 252ºpormm/1.8ºpor paso=140 Pasos por 1mm
const int motorZ = 140; //(M8=>Paso:1,43mm; 360/1,43=>1mm=252º; 252ºpormm/1.8ºpor paso=140 Pasos por 1mm
// initialize the stepper library on pins 8 through 11:
Stepper mymotorX(motorX, 2,3);
Stepper mymotorY(motorY, 4,5);
Stepper mymotorZ(motorZ, 6,7);
// ARREGLO Y VARIABLES LECTURA DE PROCESSING PARA SERVOS
int MOTORX=0, MOTORY=0, MOTORZ=0;
int motor[3] = {MOTORX, MOTORY, MOTORZ};
//int antbase=90, anthombro=86, antcodo=150, antmuneca=45, antgiro=157, antgripper=175;
// byte lector
int inByte, x, m, b, h, j, z;
int k=0;
void setup() {
pinMode(led,OUTPUT);
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
// set the speed at 60 rpm:
mymotorX.setSpeed(150);
mymotorY.setSpeed(150);
mymotorZ.setSpeed(100);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
}
void serialEvent(){
if (Serial.available() > 0){
inByte = Serial.read();
if(inByte == 'M')
modo_manual();
}
}