Arduino Serial monitor

Hi everyone, I'm a beginner code writer, I want to do an automatic irrigation project. But I have a problem. I wrote basic code and run but on the serial monitor appeared question marks, ı didnt understand(baud numbers same).

show the code that produced that, it's the only way we can help.

Okey I'm showing my code


Try that again.
In code tags, please. Haven't you read:

looks like a mismatch between the monitor baudrate and your begin statement.

1 Like

in order to "post the code"

try copying the code from the IDE by placing the mouse over the code, pressing ctl-A to select all the text and ctl-C to copy it

then in the browser window with this thread create a reply and with the mouse in the reply, hit the <code> icon and in the highlighted area, paste the code by hitting ctl-V

please give it a try

FWIW, shift-ctrl-c does a Forum-compatible copy, allowing a simple ctrl-v without the <code> button step. Six of one, half dozen of the other. "Copy for Forum" is also a menu entry.

You code screenshots are from Arduino 1.8.12, but the Serial Monitor screenshot is from IDE 2.x. Which version is it? This looks like a bug that was fixed in 2.0.4.

Yes, ı took screenshots on internet and ı have tried it in my arduino program.

My code is ;

int rolePin = 2;
int nemPin = A0;

int nemdegeri;
int nemEsikdegeri = 15;

//When the soil moisture value drops below 15 percent, the water pump will start
//You can change this moisture rate according to your own wishes.

void setup()
{
  pinMode(rolePin, OUTPUT);
  pinMode(nemPin, INPUT);
  Serial.begin(9600);
}

void loop()
{
  nemdegeri = map(analogRead(nemPin),1023,0,0,100);
  Serial.print("Nem Değeri: %");
  Serial.println(nemdegeri);

  if(nemdegeri > nemEsikdegeri)
  {
    digitalWrite(rolePin, HIGH);
  }
  else
  {
    digitalWrite(rolePin, LOW);
  }
  
  delay(100);
}

is this all of it?
i don't see where "Sulama Yapilmior" is printed

i get the following when i run the code you posted

Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15
Nem Değeri: %15

When ı connected moisture sensor, the serial monitor shows interesting marks. Do you think that there is a problem?

Hi, @tahsin55
Welcome to the forum.

What model Arduino are you using?

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

can't say without seeing the code

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.