Library with serial interface for arduino MKR W1010

Hello all,

I’m using Arduino MKR with Next-PM sensor . I found PM serial library on GitHub:

https://github.com/avaldebe/PMserial/tree/master/src.

But it is for Arduino esp8266, I tried a lot to figure out how to use it on my board but no success.

Could you help me please? It’s urgent…

My sketch is simple:

Code: [Select]

#include <PMserial.h>

Uart Serial1(&sercom5, 13, 14, SERCOM_RX_PAD_3, UART_TX_PAD_2);

void SERCOM5_Handler()
{
  Serial1.IrqHandler();
}
SerialPM pms(PM, 13, 14);  // PM Serial, RX, TX

void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
  pms.init();                   // config serial port
}

void loop() {
  pms.read();                   // read the PM sensor
  Serial.print(F("PM1.0 "));Serial.print(pms.pm01);Serial.print(F(", "));
  Serial.print(F("PM2.5 "));Serial.print(pms.pm25);Serial.print(F(", "));
  Serial.print(F("PM10 ")) ;Serial.print(pms.pm10);Serial.println(F(" [ug/m3]"));
  delay(10000);                 // wait for 10 seconds
}

Thanks in advance