Skip to main content
added 71 characters in body
Source Link
Michel Keijzers
  • 13k
  • 7
  • 42
  • 59

You have to use the begin command. Instead of:

SDS011(byte pin_rx, byte pin_tx)  

...

SDS011 my_sds;

Use

SDS011 my_sds;

(Thus remove the first line: SDS011(byte pin_rx, byte pin_tx)).

And in setup add:

my_sds.begin(0, 1);

This follows the library function of SDS011:

void begin(uint8_t pin_rx, uint8_t pin_tx);

Other errors: because you forgot the ; in

SDS011(byte pin_rx, byte pin_tx) 

the next line:

float p10,p25;

is misinterpreted, and p10 and p25 are not known. Therefore errors are shown while trying to use p10 and p25.

These errors will go when changing the begin code as described earlier.

You have to use the begin command. Instead of:

SDS011(byte pin_rx, byte pin_tx)  

...

SDS011 my_sds;

Use

SDS011 my_sds;

And in setup:

my_sds.begin(0, 1);

This follows the library function of SDS011:

void begin(uint8_t pin_rx, uint8_t pin_tx);

Other errors: because you forgot the ; in

SDS011(byte pin_rx, byte pin_tx) 

the next line:

float p10,p25;

is misinterpreted, and p10 and p25 are not known. Therefore errors are shown while trying to use p10 and p25.

These errors will go when changing the begin code as described earlier.

You have to use the begin command. Instead of:

SDS011(byte pin_rx, byte pin_tx)  

...

SDS011 my_sds;

Use

SDS011 my_sds;

(Thus remove the first line: SDS011(byte pin_rx, byte pin_tx)).

And in setup add:

my_sds.begin(0, 1);

This follows the library function of SDS011:

void begin(uint8_t pin_rx, uint8_t pin_tx);

Other errors: because you forgot the ; in

SDS011(byte pin_rx, byte pin_tx) 

the next line:

float p10,p25;

is misinterpreted, and p10 and p25 are not known. Therefore errors are shown while trying to use p10 and p25.

These errors will go when changing the begin code as described earlier.

Source Link
Michel Keijzers
  • 13k
  • 7
  • 42
  • 59

You have to use the begin command. Instead of:

SDS011(byte pin_rx, byte pin_tx)  

...

SDS011 my_sds;

Use

SDS011 my_sds;

And in setup:

my_sds.begin(0, 1);

This follows the library function of SDS011:

void begin(uint8_t pin_rx, uint8_t pin_tx);

Other errors: because you forgot the ; in

SDS011(byte pin_rx, byte pin_tx) 

the next line:

float p10,p25;

is misinterpreted, and p10 and p25 are not known. Therefore errors are shown while trying to use p10 and p25.

These errors will go when changing the begin code as described earlier.