How to interface the serial monitor back into my code

Hi, I am a new user of Arduino and I have a question. I was wondering if there was a way that if say a certain value (13) appears on my serial monitor from the dh11 temperature and humidity module to then trigger the action of another component in my circuit (the fan blade). I was looking into the serial available command but not sure how to integrate this into what I want. Thank you for any feedback.

The common way is to have the Arduino control everything and show on the serial monitor what it is doing.
In that case, the serial monitor is just a 'dumb' output and has no part in the functionality or the structure of the code.

Suppose you have the temperature in a float variable, then you can turn something on.

if( temperature > 13.0)
{
  digitalWrite( 2, HIGH);   // make pin 2 high
}

Do you want to make the decisions to turn something on, on the computer ? Then you need something running on your computer. For example a C++ program or a Python script.

Can you tell which Arduino board you have ?
Do you have programming skills ? It does not matter what language.
When you show your sketch, please put it between code-tags. You get the code-tags with the </> button.
Tell us also which DHT library you use.

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