Git Product home page Git Product logo

Comments (6)

ClintonKeith avatar ClintonKeith commented on September 9, 2024

Just a little more research on this:

I checked out the API style guide:
http://arduino.cc/en/Reference/APIStyleGuide

"When using serial communication, allow the user to specify any Stream object, rather than hard-coding "Serial". This will make your library compatible all serial ports on Mega and the Due, and can also use alternate interfaces like SoftwareSerial. The Stream object can be passed to your library's constructor or to a begin() function (as a reference, not a pointer). See Firmata 2.3 or XBee 0.4 for examples of each approach."

I'm happy to make and commit the changes for this.

from adafruit_cc3000_library.

tdicola avatar tdicola commented on September 9, 2024

Great point--just to check you're running into issues on the Due or Teensy which set the default printer right?

I agree with you and the style guide, it would be nice to let the library user pass in whatever serial or stream they want to get debug output on (or no stream for no debug output). I think adding an overloaded constructor that takes the stream as another parameter would be an option that doesn't break existing code which might depend on the current constructor. I'll make a branch to prototype it and see how it might look.

from adafruit_cc3000_library.

ClintonKeith avatar ClintonKeith commented on September 9, 2024

I was running on a Uno with a 4D display (which requires a hardware serial). So the debug stream was interfering with the 4D interface.

Thanks!

from adafruit_cc3000_library.

tdicola avatar tdicola commented on September 9, 2024

Here's a branch I made that adds an optional Print* to the constructor: https://github.com/tdicola/Adafruit_CC3000_Library/compare/cc3kprinter_refactor?expand=1

You should be able to specify an explicit hardware serial port, software serial port, or null (0) for no debug output. I was careful to keep the current behavior the same, so without specifying the printer parameter you'll still get the current behavior of using hardware serial 1. Let me know how that looks for you and I can send it as a formal pull request to merge into the library.

from adafruit_cc3000_library.

ClintonKeith avatar ClintonKeith commented on September 9, 2024

Thanks. Should we even bother with a default serial port for debug output? Normally I'd say no and I don't like it when libraries make the assumption, but because CC3000 connections are so involved, it's almost indispensable.

It's a 50/50 call for me, but I'm happy with your changes.

from adafruit_cc3000_library.

tdicola avatar tdicola commented on September 9, 2024

Just merged in the fixes to add the optional printer in the constructor so I'll close this one now. Thanks again for suggesting the change!

from adafruit_cc3000_library.

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.