Comments (6)
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.
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.
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.
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.
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.
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)
- Server doesn't support UDP or Datagram HOT 6
- Larger data packet than available buffer causes memory overwrite
- fastprint hang (buildtest fails to ping) HOT 2
- Error -85 getting when trying to connect CC3000 to any webserver
- WebClient example crashes on large file downloads HOT 13
- compiling issue in Eclipse CDT HOT 1
- fastrprint sometimes returns negative values HOT 1
- Arduino Due HOT 1
- Does not reconnect automatically
- Client objects are not marked as disconnected when disassociated HOT 1
- Adafruit_CC3000_Client disconnects after a few minutes HOT 1
- intermittant hangs in read loop HOT 9
- Release 1.0.1/1.0.2 contain version 1.0.0 in library.properties HOT 1
- CC3000 can't connect with MQTT broker using IPAddress Object
- fastrprint crash on long string
- Support for Arduino IDE >=1.6
- Use vendor zone for pool.ntp.org HOT 1
- Sending sensor data to pc via arduono and adafruit cc3000
- Sending sensor data to pc via arduono and adafruit cc3000
- freegeoip.net doesn't exist any more HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit_cc3000_library.