I want to turn on my LED connected to arduino board once it satisfies any condition provded in my python program.
These are the conditions:
Temperature < 28 , Humidity < 60 , Moisture> 179:
Observation= 'Temperature & Humidity is less.'
Temperature > 28 , Humidity < 60 , Moisture< 179:
Observation= 'Humidity & Moisture is less.'
Temperature < 28 , Humidity > 60 , Moisture < 179:
Observation = 'Temperature & Moisture is less.'
I want the LED to turn on when the output is : '<pre>Humidity & Moisture is less.
I have created a code to user input the data and predict the value:
x=int(input("Enter the tmp:"))
y=int(input("Enter the hum:"))
z=int(input("Enter the moist:"))
y_pred = loaded_model.predict(xc)
Once we enter the inputs the ouput will get displayed through 'y pred' respective to the condition provided.
I want the led to turn on when y pred gives an output as 'Temperature & Moisture is less.'
What will be the python code to turn on the led based on this?
What I have tried:
I have tried :
from pyfirmata import util, Arduino
board = Arduino('COM5')
it = util.Iterator(board)
led_13 = board.get_pin('d:13:o')
if __name__ == '__main__':
inorder to check whether the led will turn on or not. And the led turned on. Now I want to know how can I turn the LED based on the conditions provided above.