Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support of generic streams instead of hardcoded software serial. #8

Merged
merged 1 commit into from
Mar 2, 2019

Conversation

vladkozlov69
Copy link

Hello Tobias,

I've refactored your code a bit to make it working with any Stream& and not only SoftwareSerial (tested using STM32 HardwareSerial and SC16IS750 I2C-to-UART board).
Decided to share my changes with you.

@tobiasschuerg tobiasschuerg self-requested a review January 3, 2019 09:14
@tobiasschuerg
Copy link
Owner

Thanks a lot. I'll test with my setup once got time an merge. 👍

@vladkozlov69
Copy link
Author

Just in case here is a snippet from my sketch:

`#include <Wire.h>
#include <SC16IS750.h>
#include <MHZ.h>

#define MHZ_PWM_PIN PC13

SC16IS750 i2cuart = SC16IS750(SC16IS750_PROTOCOL_I2C, SC16IS750_ADDRESS_AA);
MHZ co2(&i2cuart, MHZ_PWM_PIN, MHZ19B);

void setup()
{
Wire.begin();
i2cuart.begin(9600);
}`

@tobiasschuerg tobiasschuerg merged commit db2472a into tobiasschuerg:master Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants