Bladeren bron

Make sure _Ex_PINS is defined

Also fix analogInputToDigitalPin so it uses proper C hex notation
Scott Lahteine 10 jaren geleden
bovenliggende
commit
ae4b348d77
3 gewijzigde bestanden met toevoegingen van 108 en 7 verwijderingen
  1. 1
    1
      Marlin/Marlin.h
  2. 4
    6
      Marlin/pins.h
  3. 103
    0
      Marlin/pins_MEGATRONICS_3.h

+ 1
- 1
Marlin/Marlin.h Bestand weergeven

@@ -34,7 +34,7 @@
34 34
 
35 35
 // Arduino < 1.0.0 does not define this, so we need to do it ourselves
36 36
 #ifndef analogInputToDigitalPin
37
-# define analogInputToDigitalPin(p) ((p) + A0)
37
+# define analogInputToDigitalPin(p) ((p) + 0xA0)
38 38
 #endif
39 39
 
40 40
 #ifdef AT90USB

+ 4
- 6
Marlin/pins.h Bestand weergeven

@@ -112,20 +112,18 @@
112 112
 
113 113
 // List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
114 114
 #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN, analogInputToDigitalPin(TEMP_0_PIN),
115
+#define _E1_PINS
116
+#define _E2_PINS
117
+#define _E3_PINS
118
+
115 119
 #if EXTRUDERS > 1
116 120
   #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN, analogInputToDigitalPin(TEMP_1_PIN),
117 121
   #if EXTRUDERS > 2
118 122
     #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN, analogInputToDigitalPin(TEMP_2_PIN),
119 123
     #if EXTRUDERS > 3
120 124
       #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, HEATER_3_PIN, analogInputToDigitalPin(TEMP_3_PIN),
121
-    #else
122
-      #define _E3_PINS
123 125
     #endif
124
-  #else
125
-    #define _E2_PINS
126 126
   #endif
127
-#else
128
-  #define _E1_PINS
129 127
 #endif
130 128
 
131 129
 #ifdef X_STOP_PIN

+ 103
- 0
Marlin/pins_MEGATRONICS_3.h Bestand weergeven

@@ -0,0 +1,103 @@
1
+/**
2
+ * MegaTronics v2.0 pin assignments
3
+ */
4
+
5
+#ifndef __AVR_ATmega2560__
6
+  #error Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
7
+#endif
8
+
9
+#define LARGE_FLASH        true
10
+
11
+#define X_STEP_PIN 26
12
+#define X_DIR_PIN 27
13
+#define X_ENABLE_PIN 25
14
+#define X_MIN_PIN 37
15
+#define X_MAX_PIN 40
16
+
17
+#define Y_STEP_PIN 4 // A6
18
+#define Y_DIR_PIN 54 // A0
19
+#define Y_ENABLE_PIN 5
20
+#define Y_MIN_PIN 41
21
+#define Y_MAX_PIN 38
22
+
23
+#define Z_STEP_PIN 56 // A2
24
+#define Z_DIR_PIN 60 // A6
25
+#define Z_ENABLE_PIN 55 // A1
26
+#define Z_MIN_PIN 18
27
+#define Z_MAX_PIN 19
28
+
29
+#define E0_STEP_PIN 35
30
+#define E0_DIR_PIN 36
31
+#define E0_ENABLE_PIN 34
32
+
33
+#define E1_STEP_PIN 29
34
+#define E1_DIR_PIN 39
35
+#define E1_ENABLE_PIN 28
36
+
37
+#define E2_STEP_PIN 23
38
+#define E2_DIR_PIN 24
39
+#define E2_ENABLE_PIN 22
40
+
41
+#define SDPOWER -1
42
+#define SDSS 53
43
+#define LED_PIN 13
44
+
45
+#define FAN_PIN 7
46
+#define FAN2_PIN 6
47
+#define PS_ON_PIN 12
48
+#define KILL_PIN -1
49
+
50
+#define HEATER_0_PIN 9 // EXTRUDER 1
51
+#define HEATER_1_PIN 8 // EXTRUDER 2
52
+#define HEATER_2_PIN -1
53
+
54
+#if TEMP_SENSOR_0 == -1
55
+  #define TEMP_0_PIN 4 // ANALOG NUMBERING
56
+#else
57
+  #define TEMP_0_PIN 13 // ANALOG NUMBERING
58
+#endif
59
+
60
+
61
+#if TEMP_SENSOR_1 == -1
62
+  #define TEMP_1_PIN 8 // ANALOG NUMBERING
63
+#else
64
+  #define TEMP_1_PIN 15 // ANALOG NUMBERING
65
+#endif
66
+
67
+#define TEMP_2_PIN -1 // ANALOG NUMBERING
68
+
69
+#define HEATER_BED_PIN 10 // BED
70
+
71
+#if TEMP_SENSOR_BED == -1
72
+  #define TEMP_BED_PIN 8 // ANALOG NUMBERING
73
+#else
74
+  #define TEMP_BED_PIN 14 // ANALOG NUMBERING
75
+#endif
76
+
77
+#define BEEPER 64
78
+
79
+
80
+#define LCD_PINS_RS 14
81
+#define LCD_PINS_ENABLE 15
82
+#define LCD_PINS_D4 30
83
+#define LCD_PINS_D5 31
84
+#define LCD_PINS_D6 32
85
+#define LCD_PINS_D7 33
86
+
87
+
88
+// Buttons are directly attached using keypad
89
+#define BTN_EN1 61
90
+#define BTN_EN2 59
91
+#define BTN_ENC 43 //the click
92
+
93
+#define BLEN_C 2
94
+#define BLEN_B 1
95
+#define BLEN_A 0
96
+
97
+#define SDCARDDETECT -1  // Megatronics does not use this port
98
+
99
+// Encoder rotation values
100
+#define encrot0 0
101
+#define encrot1 2
102
+#define encrot2 3
103
+#define encrot3 1

Laden…
Annuleren
Opslaan