Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Reflection;
- using System.Runtime.CompilerServices;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Print(float str)
- {
- Console.Write(str);
- }
- static bool CheckRain()
- {
- //int pin = ...;
- // pinMode(pin, INPUT);
- // int indicateur = analogRead(pin);
- int indicateur = 0;
- return indicateur == 0;
- }
- static bool CheckTemperature()
- {
- // int pin = ...;
- // pinMode(pin, INPUT);
- // int temp = analogRead(pin);
- int temp = 0;
- if (temp < 3)
- return true;
- return false;
- }
- static bool CheckHumidity()
- {
- // int pin = ...;
- // pinMode(pin, INPUT);
- // int humidity = analogRead(pin);
- int humidity = 0;
- if (humidity > 0.6)
- return true;
- return false;
- }
- static bool CheckWind()
- {
- // int pin = ...;
- // pinMode(pin, INPUT);
- // int humidity = analogRead(pin);
- float wind = 0;
- if (wind > 0.9)
- return true;
- return false;
- }
- static int Yes()
- {
- bool temp = CheckTemperature();
- if (temp)
- return 110;
- return 120;
- }
- static int No()
- {
- bool humidity = CheckHumidity();
- if (humidity)
- {
- bool temp = CheckTemperature();
- if (temp)
- return 110;
- bool wind = CheckWind();
- if (wind)
- return 110;
- return 120;
- }
- else
- {
- bool wind = CheckWind();
- if (wind)
- return 120;
- return 130;
- }
- }
- static void Setup()
- {
- // Serial.begin(9600);
- }
- static void Loop()
- {
- bool isRain = CheckRain();
- if (isRain)
- Print(Yes());
- else
- Print(No());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement