My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pin_interrupt_test.ino 907B

12345678910111213141516171819202122232425262728293031
  1. // Search pins usable for endstop-interrupts
  2. // Compile with the same build settings you'd use for Marlin.
  3. #if defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_AVR_MEGA)
  4. #define moreDigitalPinToPCICR(p) digitalPinToPCICR(WITHIN(p, 13, 14) ? 10 : p)
  5. #else
  6. #define moreDigitalPinToPCICR(p) digitalPinToPCICR(p)
  7. #endif
  8. void setup() {
  9. Serial.begin(9600);
  10. Serial.println("PINs causing interrupts are:");
  11. for (int i = 2; i < NUM_DIGITAL_PINS; i++) {
  12. if (moreDigitalPinToPCICR(i) || (int)digitalPinToInterrupt(i) != -1) {
  13. for (int j = 0; j < NUM_ANALOG_INPUTS; j++) {
  14. if (analogInputToDigitalPin(j) == i) {
  15. Serial.print('A');
  16. Serial.print(j);
  17. Serial.print(" = ");
  18. }
  19. }
  20. Serial.print('D');
  21. Serial.println(i);
  22. }
  23. }
  24. Serial.println("Arduino pin numbering!");
  25. }
  26. void loop() {
  27. // put your main code here, to run repeatedly:
  28. }