2017-05-20 19:30:36 -05:00
|
|
|
// Search pins usable for endstop-interrupts
|
|
|
|
// Compile with the same build settings you'd use for Marlin.
|
2016-11-05 16:38:48 -05:00
|
|
|
|
|
|
|
#if defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_AVR_MEGA)
|
2019-11-02 06:59:38 -05:00
|
|
|
#define moreDigitalPinToPCICR(p) digitalPinToPCICR(WITHIN(p, 14, 15) ? 10 : p)
|
2019-10-30 15:52:02 -05:00
|
|
|
#else
|
|
|
|
#define moreDigitalPinToPCICR(p) digitalPinToPCICR(p)
|
2016-11-05 16:38:48 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void setup() {
|
|
|
|
Serial.begin(9600);
|
2017-11-19 23:00:43 -06:00
|
|
|
Serial.println("PINs causing interrupts are:");
|
2017-05-20 19:30:36 -05:00
|
|
|
for (int i = 2; i < NUM_DIGITAL_PINS; i++) {
|
2019-10-30 15:52:02 -05:00
|
|
|
if (moreDigitalPinToPCICR(i) || (int)digitalPinToInterrupt(i) != -1) {
|
2017-05-20 19:30:36 -05:00
|
|
|
for (int j = 0; j < NUM_ANALOG_INPUTS; j++) {
|
|
|
|
if (analogInputToDigitalPin(j) == i) {
|
|
|
|
Serial.print('A');
|
2016-11-05 16:38:48 -05:00
|
|
|
Serial.print(j);
|
|
|
|
Serial.print(" = ");
|
|
|
|
}
|
|
|
|
}
|
2017-05-20 19:30:36 -05:00
|
|
|
Serial.print('D');
|
2016-11-05 16:38:48 -05:00
|
|
|
Serial.println(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Serial.println("Arduino pin numbering!");
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
// put your main code here, to run repeatedly:
|
|
|
|
}
|