Replies: 5 comments
-
Hi - thx for the greate library - have moved over to your library because auf time.h - incompatibilities of the alternative. Note 1) ESP-Serial issueThe following code works and is flexible for alternative pins HarwareSerial pmsSerial(2);
SerialPM pms(PMSx003, pmsSerial);
[...]
setup(){
[...]
pmsSerial.begin(9600, SERIAL_8N1, 16, 17)
} Note 2) SleepIn #2 you mention an workaround by editing the library with void SerialPM::sleep() {
trigRead(slp,msgLen); // sleep
}
void SerialPM::wake() {
trigRead(wak,msgLen); // sleep
} but trigRead() has as fare as I can see no parameters. Perhaps you have to add: void SerialPM::wake() {
uart->write(wak, msgLen); // wakeup
uart->flush();
delay(max_wait_ms * 2);
while (uart->available())
{
uart->read(); // empty the RX buffer
}
} Perhaps you can include this function in the standard library or add this option in issue 2. Thanks for your work and congratulation for the efficient lines :-) |
Beta Was this translation helpful? Give feedback.
-
Hi @SFeli Thanks fort taking an interest on my library.
I think that this use case was addressed on #7. This library uses Serial1 on the ESP32 to connect a PM sensor on user defined pins. Probably the explanation is not clear enough. |
Beta Was this translation helpful? Give feedback.
-
This code snippet is not mine, It was part of an attempt by a library user to implement sleep. Do you need/want sleep/wake modes? |
Beta Was this translation helpful? Give feedback.
-
Can we have some more documentation around how to setup and steps to use this code? |
Beta Was this translation helpful? Give feedback.
-
In addition to the examples?
I have not used the Arduino IDE on years, back on the days before the Library Manager, so I do not know how to add libraries to the IDE. In any case, I think there are plenty of tutorials that teach how to do it, e.g.:
I think I could add some links to the library README. Please let me know if you have a better idea.
I included links to the datasheets I could find for every supported sensors, but I guess this is not enough for a beginner. |
Beta Was this translation helpful? Give feedback.
-
If you do not understand how to use the library, found an explanation confusing or you found a typo. Leave a message and will try to answer as soon as reasonable.
Thanks for helping to improve the library!
Beta Was this translation helpful? Give feedback.
All reactions