Comments (9)
I can't read it all through, unfortunately - I would guess you could just write myMHZ19.begin(Serial), as the base class (Stream) is inherited from the UartClass they've built on top of the HardwareSerial class. *Failing this, you could still configure their HardwareSerial library, which should work.
I would ask them if you're not sure as it's not really an issue for this library.
from mh-z19.
I edit the Setup like this:
void setup()
{
Serial.begin(9600); // Device to serial monitor feedback
// mySerial.begin(BAUDRATE); // (Uno example) device to MH-Z19 serial start
//mySerial.begin(BAUDRATE, SERIAL_8N1, RX_PIN, TX_PIN); // (ESP32 Example) device to MH-Z19 serial start
myMHZ19.begin(Serial); // *Serial(Stream) refence must be passed to library begin().
myMHZ19.autoCalibration(); // Turn auto calibration ON (OFF autoCalibration(false))
}
Now the Compilation works.. Software Serial needs so much space... After removing SoftwareSerial it wonβt fit. But after using your Testing-Branch the Code fit to 4kb.. 3415 Bytes are used (83%).. I think it could be improved but for me important is that it fits. When my Attiny arrives I will test it.
from mh-z19.
Very nice! Yes, it does take a lot of space... let me know if you have any issues with the testing branch version.
from mh-z19.
Hey, if it uses Arduino, yes.
You need to declare a Serial instance from the default Arduino libraries and pass it into the begin function once it's initiated. If you look at the examples, you'll see an ESP32 comment regarding its hardware serial, it will likely work like this.
Without seeing the Arduino package behind the Attinty 404 however, it's hard to be more specific. Do you have a link to a board?
from mh-z19.
Hey,
That Type is Not native from arduino.. it uses an Core like the esp32 Boards.
Here is the link to the Core for supporting Attinys in the arduino IDE:
https://github.com/SpenceKonde/megaTinyCore
from mh-z19.
Ah,
Not entirely sure I'm right here as I can't look at this for long, but looks like the datasheet shows a single UART. (page 10).
Assuming this is the correct header for the board, it also looks like the hardware serial is only declared once.
However, the UART library can expect up 4..
This means you need to use SoftwareSerial if you plan to use the Serial for a terminal or uploading code - double check with the designer of the module.
from mh-z19.
Ah,
Not entirely sure I'm right here as I can't look at this for long, but looks like the datasheet shows a single UART. (page 10).
Assuming this is the correct header for the board, it also looks like the hardware serial is only declared once.
However, the UART library can expect up 4..
This means you need to use SoftwareSerial if you plan to use the Serial for a terminal or uploading code - double check with the designer of the module.
I checked it but I don't need serial for uploading code. One pin is used for uploading code (UPDI).. So I think that I can use the (hardware) serial Connection.
EDIT 1:
Please check my link to the module and read the readme... There is the serial connection explained. I hope I can help.
from mh-z19.
Yep i will do. I only need to find out how to specify the Serial-Pins... I will contact the maintainer of megaTinyCore..
from mh-z19.
Closed for now, feel free to open if any more issues.
from mh-z19.
Related Issues (20)
- get background CO2 HOT 2
- Add MH-Z16 and below 400ppm measurements, set different range / sensititivies of sensors used. HOT 1
- Wrong Temperature - wrong Co2? HOT 18
- Readings way off HOT 7
- does not work on arduino mega HOT 4
- Reasoning behind sensor zero-calibration ? HOT 1
- Simplification proposal HOT 3
- Temperature values among different sensors HOT 4
- Library incompatible with I2C LCD? HOT 3
- Getting wrong temperature on MH-z19c HOT 7
- ESP32C3 support. HOT 3
- Question. Correct interpretation of sensor readings HOT 4
- Backup / Restore Firmware using ST-Link v2 and OpenOCD HOT 3
- MH-Z19B measures well the first 15 minutes, then 0 ppm HOT 5
- ERROR 3 after powercycle - firmware download blocks init HOT 3
- library fails with CORE_DEBUG_LEVEL=3 HOT 1
- Failed communication via UART (ESP32) HOT 3
- Error Code 3 HOT 6
- Cannot connect the sensor properly HOT 5
- Incorrect PPM range with sensor HOT 1
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 mh-z19.