Commit d0e644bf authored by 42loop's avatar 42loop
Browse files

introducing real pinout

parent 24ec48dc
......@@ -4,54 +4,76 @@
#define ENCODER_OPTIMIZE_INTERRUPTS
#include <Encoder.h>
#define encXA 2
#define encXB 9
#define encYA 3
#define encYB 19
#define encZA 0
#define encZB 0
//encoder inputs, 5V signal
#define encXA 24
#define encXB 25
#define encYA 26
#define encYB 27
#define encZA 28
#define encZB 29
//switch inputs, clamped to 5V by zener diode
#define limitXM 0
#define limitXP 1
#define refX 2
#define limitYM 3
#define limitYP 4
#define refY 5
#define limitZM 6
#define limitZP 7
#define refZ 8
//ready inputs from servo amplifiers
#define readyX 9
#define readyY 10
#define readyZ 11
//output to reed relais
#define enableX 33
#define enableY 34
#define enableZ 35
//encoder objects
Encoder encX(encXA, encXB);
Encoder encY(encYA, encYB);
Encoder encZ(encZA, encZB);
#define limitXM 12
#define limitXP 12
#define refX 12
#define limitYM 12
#define limitYP 12
#define refY 12
#define limitZM 12
#define limitZP 12
#define refZ 12
#define enableX 8
#define enableY 11
#define enableZ 11
//adjust to actual pin numbers:
byte enablepins[]={enableX,enableY,enableZ};
byte limitMpins[]={limitXM,limitYM,limitZM};
byte limitPpins[]={limitXP,limitYP,limitZP};
byte readypins[]={readyX,readyY,readyZ};
byte refpins[]={refX,refY,refZ};
void reportinputs()
{
Serial.println("limitXM\tlimitYM\tlimitZM\tlimitXP\tlimitYP\tlimitZP\trefX\trefY\trefZ\treadyX\treadyY\treadyZ");
Serial.print(digitalRead(limitXM));Serial.print("\t");
Serial.print(digitalRead(limitYM));Serial.print("\t");
Serial.print(digitalRead(limitZM));Serial.print("\t");
Serial.print(digitalRead(limitXP));Serial.print("\t");
Serial.print(digitalRead(limitYP));Serial.print("\t");
Serial.print(digitalRead(limitZP));Serial.print("\t");
Serial.print(digitalRead(refX));Serial.print("\t");
Serial.print(digitalRead(refY));Serial.print("\t");
Serial.print(digitalRead(refZ));Serial.print("\t");
Serial.print(digitalRead(readyX));Serial.print("\t");
Serial.print(digitalRead(readyY));Serial.print("\t");
Serial.println(digitalRead(readyZ));
}
//da-wandler:
#define ltc_load 4
#define ltc_clk 5
#define ltc_data 6
#define mux_enable 7
#define mux_a0 10
#define mux_a1 14
#define mux_a2 15
#define ltc_load 36
#define ltc_clk 37
#define ltc_data 38
#define mux_enable 39
#define mux_a0 30
#define mux_a1 31
#define mux_a2 32
......@@ -291,8 +313,11 @@ pinMode(limitZM,INPUT);
pinMode(refX,INPUT);
pinMode(refY,INPUT);
pinMode(refZ,INPUT);
pinMode(readyX,INPUT);
pinMode(readyY,INPUT);
pinMode(readyZ,INPUT);
/*
digitalWrite(limitXP,HIGH);
digitalWrite(limitXM,HIGH);
digitalWrite(limitYP,HIGH);
......@@ -302,7 +327,10 @@ digitalWrite(limitZM,HIGH);
digitalWrite(refX,HIGH);
digitalWrite(refY,HIGH);
digitalWrite(refZ,HIGH);
digitalWrite(readyX,HIGH);
digitalWrite(readyY,HIGH);
digitalWrite(readyZ,HIGH);
*/
pinMode(led,OUTPUT);
digitalWrite(led,HIGH);
......@@ -311,6 +339,7 @@ Serial.begin(115200);
Serial.println("\fonline...");
for (int l=0;l<1000;l++) {reportinputs();delay(1000);}
/*
attachInterrupt(0, doEncoderX, RISING); // encoder pin on interrupt 0 - pin 2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment