Giter Club home page Giter Club logo

Comments (4)

2bndy5 avatar 2bndy5 commented on September 22, 2024

printf_begin(); is call after Serial is started. This code worked flawlessly with and RF-Nano but not for the MKR?

Our library's printf_begin() is just a helper function to integrate the RF24 library's printf() calls with the default Serial object, but it only does this for boards that can use printf()

Radio.sprintfPrettyDetails(buffer); works fine????

Of course it does, because it doesn't use printf(). It uses sprintf() (which uses buffers instead of a stream like printf() does). The functions sprintfPrettyDetails() and encodeRadioDetails() were designed as an alternative way to get debugging information on boards that don't support printf().

I think your confusion is really just from not understanding the difference between printf() and sprintf() functions from the C standard library (cstdio.h).

MKR1010 uses a ATSAMD21 chip

That board uses the Arduino SAMD core, which does not support printf().

Tip

An Adafruit board that uses the ATSAMD21 can use printf() because it is supported by Adafruit's fork of the Arduino SAMD core.

RF-Nano uses ATmega328

That board just uses the Arduino AVR core which does support printf().

from rf24.

bvernham avatar bvernham commented on September 22, 2024

Has it been considered to use LibPrintf library.

Work fine with MKR1010.

from rf24.

2bndy5 avatar 2bndy5 commented on September 22, 2024

No, we haven't considered using another library just for debugging output on some boards.

LibPrintf hasn't been updated in years. If there were problems, then we (and our users) would have to hope that the LibPrintf authors are still responsive... 👎

If you're using PlatformIO, then it would be easy to make RF24 use LibPrintf. You just need to add a #define to the build_flags.

build_flags =
  -Dprintf_P=printf

Otherwise, if you're using Arduino IDE with a board that doesn't support printf(), then you can use sprintfPrettyDetails().

from rf24.

2bndy5 avatar 2bndy5 commented on September 22, 2024

No, we haven't considered using another library just for debugging output on some boards.

This isn't entirely true. We had started developing RF24Log but stopped when we couldn't decide on how to control verbosity (logging level) per origin of logs.

from rf24.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.