Серийную отладку можно сделать по условию:
Arduino код:
#define DEBUG 1
...
#ifdef DEBUG
Serial.print("Some debug stuff follows");
// More debug code...
#endif
---------- Сообщение добавлено в 23:54 ---------- Предыдущие сообщение было в 23:46 ----------
Цитата:
Сообщение от Alexmit
Так на нём же RS485 стоит.
|
Смотря где. Если используется библиотека XPressNet, то там стоит условие:
Arduino код:
// Which serial port is used, if we have more than one on the chip?
// note that the 328s (the currently produced "smaller" chips) only
// have one serial port, so we force this.
#ifdef __AVR_ATmega328P__
#[B]define SERIAL_PORT_0[/B]
#undef SERIAL_PORT_1
#else
//Maybe we are running on a MEGA chip with more than 1 port? If so, you
//can put the serial port to port 1, and use the port 0 for status messages
//to your PC.
#define SERIAL_PORT_1
#undef SERIAL_PORT_0
#endif
// when sending data, do NOT continue until the hardware has sent the data out
#ifdef __AVR_ATmega8__
#define WAIT_FOR_XMIT_COMPLETE {while (!(UCSRA & (1<<TXC))); UCSRA = (1<<TXC); UCSRA = 0;}
#else
#ifdef SERIAL_PORT_0
#define WAIT_FOR_XMIT_COMPLETE {while (!(UCSR0A & (1<<TXC0))); UCSR0A = (1<<TXC0); UCSR0A = 0;}
#else
#define WAIT_FOR_XMIT_COMPLETE {while (!(UCSR1A & (1<<TXC1))); UCSR1A = (1<<TXC1); UCSR1A = 0;}
#endif
#endif