Skip to content

Instantly share code, notes, and snippets.

@RobolinkAkademi
Last active October 28, 2019 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobolinkAkademi/0f3907b29569789da5fb2c856ce526f7 to your computer and use it in GitHub Desktop.
Save RobolinkAkademi/0f3907b29569789da5fb2c856ce526f7 to your computer and use it in GitHub Desktop.
tum_yil_icin_arduino_mufredati_26.2
#include "LedControl.h"
int DIN = 5;//dot matrix bağlantısı
int CS = 4;
int CLK = 3;
#include <Wire.h>//ısı nem cihazı bağlantısı
#include <DHT.h>
#define DHTPIN 8
#define DHTTYPE DHT11
DHT dht(DHTPIN,DHTTYPE);
byte gulumseyen[8]= {0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C};
//gulumseyen suratın hexadecimal karşılığı
byte uzgun[8]= {0x3C,0x42,0xA5,0x81,0x99,0xA5,0x42,0x3C};
//uzgun suratın hexadecimal karşılığı
LedControl lc=LedControl(DIN,CLK,CS,0);
void setup(){
lc.shutdown(0,false); //Max72xx açılır
lc.setIntensity(0,1); // parklaklıhı ayarlar
lc.clearDisplay(0); // ekranı temizler
pinMode(8,INPUT);
dht.begin();
}
void loop(){
float t=dht.readTemperature();//sıcaklık ölçümü
Serial.begin(9600);
Serial.println("Sicaklik:");
Serial.print(t);
if(t>28)///sıcaklık 28dereceden büyükse
{
printByte(uzgun);
delay(100);
}
else if (t<28)
{
printByte(gulumseyen);
delay(5000);
}
}
void printByte(byte character [])//suratın belirmesi için ledlere sinyal gönderilmesi
{
int i = 0;
for(i=0;i<8;i++)
{
lc.setRow(0,i,character[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment