programming error...Need Help!!

i have tried compiling the following code in Arduino IDE 0023 , because there was some incompatibility issues with IDE V1.0 or above

//Compatible with Arduino IDE 22/23
#include <sunflower.h> //library
#define MoistureSensor 3 // the port moistureSensor connected to 
sunflower flower;
void setup()
{
Serial.begin(115200); //Baudrate 115200
flower.Initialization(); //Initialization 
}
void loop()
{
flower.SerialSet(MoistureSensor);
//get the settings from the PC software and the moisture value
flower.process(); //get the temperature and humidity value
flower.Potentiometer(); //get the watering threshold value
flower.print();
//output data including temperature, humidity, watering threshold value, moisture value.
delay(500);
}

on compiling i have recieved the following ERROR:

sketch_oct23a:11: error: 'class sunflower' has no member named 'SerialSet'
sketch_oct23a:14: error: 'class sunflower' has no member named 'Potentiometer'

can anyone please help me resolve this error

this code is for my technical thesis project.
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=2157757&

Moderator edit: Colour tags replace with CODE TAGS

have you put libraries in the right place?

The error messages are pretty clear and explicit, but you haven't posted the code for the library.

The error messages are pretty clear and explicit, but you haven't posted the code for the library.

It's on the site OP linked to. The compiler is absolutely right. The sunflower class does not have those members. Why did you think it did?

From the linked code (the compiler won't complain about this pile of pooh)

 if(Serial.available()>0)
  {
          x[0]=Serial.read();
          x[1]=Serial.read();
          x[2]=Serial.read();
          x[3]=Serial.read();
          x[4]=Serial.read();
          SUM=x[0]+x[1]+x[2]+x[3];
          if(SUM==x[4])

the compiler won't complain about this pile of pooh

It goes without saying that reading 5 of the 1 or more characters available is not a good idea.

It goes without saying

..and yet it got published.

AWOL:

It goes without saying

..and yet it got published.

Must be someone that slipped in a delay (50) elsewhere in the code "to make it work".

So what do you propose i do to solve this problem? And yes i have put the libraries in the right place! Please i need to get done with it ASAP

And PaulS what do you mean by "that reading 5 of the 1 or more characters available is not a good idea"?

if(Serial.available()>0)
  {
          x[0]=Serial.read();
          x[1]=Serial.read();
          x[2]=Serial.read();
          x[3]=Serial.read();
          x[4]=Serial.read();

The first line guarantees you have one byte. Not 5.

You might write:

if(Serial.available() >= 5)
  {
          x[0]=Serial.read();
          x[1]=Serial.read();
          x[2]=Serial.read();
          x[3]=Serial.read();
          x[4]=Serial.read();

Thank you that was very helpful!

About the class sunflower members should i introduce the members: SerialSet and Potentiometer in the library files sunflower.h and sunflower.cpp?

You can if you want to. I haven't studied the class enough to know if you might want to.

Well this is what the potentiometer should do according to the instructions:

You can rotate the potentiometer on the board to change the watering threshold value. Once the
soil moisture value reaches the threshold value, the system will start to water the plant.

The potentiometer is to set the watering threshold value according to the following range of analog values received from the soil moisture sensor :
0 ~300 : dry soil
300~700 : humid soil
700~950 : in water
So it would be preferable to set the watering threshold to 700~950 : in water!

And for the

    flower.SerialSet(MoistureSensor);
    //get the settings from the PC software and the moisture value

....I found this code in the library in sunflower.cpp found in the AFWS sample code that i mentioned above and i was wondering if this is the part of the code that gets the settings from the PC software and the moisture value too

  void sunflower::moisture()
    {
          humidity=analogRead(3);
          dat2=humidity/500*100;
    }

What does SerialSet mean here?

Can you tell me how should i introduce these in sunflower.cpp and in sunflower.h library files in the AFWS Sample Code(Arduino) mentioned in the link?