Giter VIP home page Giter VIP logo

Comments (9)

WifWaf avatar WifWaf commented on June 11, 2024 1

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.

By the way, if you look at the testing branch, there is a version of this library that uses significantly less memory - though as indicated by the name, it hasn't been thoroughly tested. It also has updated examples.

from mh-z19.

DerPicknicker avatar DerPicknicker commented on June 11, 2024 1

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.

WifWaf avatar WifWaf commented on June 11, 2024 1

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.

WifWaf avatar WifWaf commented on June 11, 2024

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.

DerPicknicker avatar DerPicknicker commented on June 11, 2024

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.

WifWaf avatar WifWaf commented on June 11, 2024

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.

DerPicknicker avatar DerPicknicker commented on June 11, 2024

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.

DerPicknicker avatar DerPicknicker commented on June 11, 2024

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.

WifWaf avatar WifWaf commented on June 11, 2024

Closed for now, feel free to open if any more issues.

from mh-z19.

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.