Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Arduino baslangic dersleri 11
#include<DHT11.h>
#define Sensor_pin 4
#define kirmiziPin 5
#define maviPin 6
DHT11 dgt11(Sensor_pin);
float Nem=0, Sicaklik=0
float Mavi_deger=0, Kirmizi_deger=0;
void setup()
{
Serial.begin(9600);
pinMode(maviPin, OUTPUT);
pinMode(kirmiziPin, OUTPUT);
}
void loop()
{
int sensor_oku=dht11.read(Nem, Sicaklik);
Serial.print("Nem = ");
Serial.print(Nem,2);
Serial.print(" , ");
Serial.print("Sicaklik = ");
Serial.println(Sicaklik,2);
Mavi_deger = 250-(10"Sicaklik);
if(Mavi_deger<0)
Mavi_deger=0;
Kirmizi_deger=(10*Sicaklik)-250;
if(Kirmizi_deger<0)
Kirmizi_deger=0;
analogWrite(maviPin, Mavi_deger);
analog(kirmiziPin,Kirmizi_deger);
delay(2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.