paolocbr errore arduino #define _SET_INPUT(IO) do {DIO ## IO ## _DDR &= ~MASK(DIO ## IO ## _PIN

/// Read a pin
#define _READ(IO) ((bool)(DIO ## IO ## _RPORT & MASK(DIO ## IO ## _PIN)))
/// write to a pin
#define _WRITE(IO, v) do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
/// toggle a pin
#define _TOGGLE(IO) do {DIO ##  IO ## _RPORT = MASK(DIO ## IO ## _PIN); } while (0)

/// set pin as input
#define _SET_INPUT(IO) do {DIO ##  IO ## _DDR &= ~MASK(DIO ## IO ## _PIN); } while (0)
/// set pin as output
#define _SET_OUTPUT(IO) do {DIO ##  IO ## _DDR |=  MASK(DIO ## IO ## _PIN); } while (0)

/// check if pin is an input
#define _GET_INPUT(IO) ((DIO ## IO ## _DDR & MASK(DIO ## IO ## _PIN)) == 0)
/// check if pin is an output

Comments

  • If you get an error message around these you are normally using a pin name with no underlying pin number - most likely because your board does not have it defined or because the processor does not have that pin number. For more details show the error message you got compiling.
  • #define _SET_INPUT(IO) do {DIO ##  IO ## _DDR &= ~MASK(DIO ## IO ## _PIN); } while (0);
    error: "DIOMISO_PIN_DDR" was not declared in this scope
  • So somehow there is no
    #define MISO_PIN 13

    and it can not evaluate the expression correctly. What board are you using? All boards should have a MISO_PIN.
  • versione app: 1.8.12
    tipo di Arduino utilizzato: Arduino Mega 2560

  • I mean which motherboard for the printer like RAMPS, Rumba. Arduino Mega 2560 is just a processor that is used by many printer boards. If it is a self made board you just forgot to add the pin definition for MISO_PIN
  • la stampante è una Anycubic 4 Max Pro. Sfortunatamente non ho idea di che scheda madre utilizzi.
  • You need to define the main board to compile the firmware! It is the value of MOTHERBOARD in your configuration.h
    Also please respond in english, I don't speak italian.
  • I'm beginner. Can you explain with simply words.
  • It can be TRIGORILLA
  • Trigorilla is a RAMPS 1.4 compatible board, so you should have selected MOTHERBOARD 33 aka RAMPS 1.4 and there the problem would not happen.
    When you are compiling a firmware you must know how you configured the printer - each printer has different settings and you must have configured them - best using our configuration tool which makes it much easier.

    Actually I would upload the latest firmware from anycubic if I don't know how to configure a printer - unless of course you have made some modifications so the original will not work any more.

  • many thanks now arduino does not give me errors, the printer is connected but the controls still do not work
  • As I said all components must match your hardware and all pins and also the controller type. Most likely one of the 2 reprap discount variants. But I can't tell you what the correct values for an unknown printer are. That task is up to you if you compile it.
Sign In or Register to comment.