You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been playing around with Arduino Nano Every's using the Arduino megaAVR Baords Library.
I needed to debug and found radio.printDetails(); was not outputting to serial monitor.
Tried with the example code GettingStarted to confirm it was not my code that was causing the issue. Switched Registers Emulation to ATMEGA328 with no change. Swapping out with a 328P Nano worked fine.
Not sure if this is the correct way of doing it, however after a bit of research and testing, the below "if defined" additions to printf.h seem to solve the issue.
#if defined (ARDUINO_ARCH_AVR) || defined (__ARDUINO_X86__) || defined (ARDUINO_ARCH_MEGAAVR)
intserial_putc(char c, FILE *)
{
Serial.write(c);
return c;
}
#elif defined (ARDUINO_ARCH_MBED)
REDIRECT_STDOUT_TO(Serial);
#endif// defined (ARDUINO_ARCH_AVR) || defined (__ARDUINO_X86__) || defined (ARDUINO_ARCH_MBED) || defined (ARDUINO_ARCH_MEGAAVR)voidprintf_begin(void)
{
#if defined (ARDUINO_ARCH_AVR) || defined (ARDUINO_ARCH_MEGAAVR)
fdevopen(&serial_putc, 0);
#elif defined (__ARDUINO_X86__)
// For redirect stdout to /dev/ttyGS0 (Serial Monitor port)
stdout = freopen("/dev/ttyGS0", "w", stdout);
delay(500);
printf("Redirecting to Serial...");
#endif// defined(__ARDUINO_X86__)
}
The text was updated successfully, but these errors were encountered:
Hi,
I have been playing around with Arduino Nano Every's using the Arduino megaAVR Baords Library.
I needed to debug and found radio.printDetails(); was not outputting to serial monitor.
Tried with the example code GettingStarted to confirm it was not my code that was causing the issue. Switched Registers Emulation to ATMEGA328 with no change. Swapping out with a 328P Nano worked fine.
Not sure if this is the correct way of doing it, however after a bit of research and testing, the below "if defined" additions to printf.h seem to solve the issue.
The text was updated successfully, but these errors were encountered: