#include
#define termo A0
#define Reli 0
#define Reli1 1
#define Put_A 2
#define Put_B 3
#define Put_C 4
#define Put_D 5
#define Put_E 6
#define Put_F 7
#define Put_G 8
#define Put_H 9
#define Hane1 10
#define Hane2 11
#define Hane3 12
#define Hane4 13
int tengshek=0;
int asti=0;
int usti=0;
int chong=40;
int kichik=20;
int halet=0;
int ter = 0;
int temp = 0;
unsigned char jedwel[14][7] =
{/*
aaaaaaa
ff bb
ff bb
ff bb
ggggggg
ee cc
ee cc
ee cc
ddddddd hh*/
/*{a , b , c , d , e , f , g }, */
{1 , 1 , 1 , 1 , 1 , 1 , 0 }, //0 0
{0 , 1 , 1 , 0 , 0 , 0 , 0 }, //1 1
{1 , 1 , 0 , 1 , 1 , 0 , 1 }, //2 2
{1 , 1 , 1 , 1 , 0 , 0 , 1 }, //3 3
{0 , 1 , 1 , 0 , 0 , 1 , 1 }, //4 4
{1 , 0 , 1 , 1 , 0 , 1 , 1 }, //5 5
{1 , 0 , 1 , 1 , 1 , 1 , 1 }, //6 6
{1 , 1 , 1 , 0 , 0 , 0 , 0 }, //7 7
{1 , 1 , 1 , 1 , 1 , 1 , 1 }, //8 8
{1 , 1 , 1 , 1 , 0 , 1 , 1 }, //9 9
{1 , 1 , 1 , 0 , 1 , 1 , 1 }, //A 10
{0 , 1 , 1 , 1 , 1 , 1 , 0 }, //U 11
{0 , 1 , 1 , 0 , 1 , 1 , 1 }, //H 12
{0 , 0 , 0 , 0 , 0 , 0 , 1 } //- 13
};
unsigned char hane_jedwel[4][4] ={{0,1,1,1},{1,0,1,1},{1,1,0,1},{1,1,1,0}};
void setup()
{ pinMode(Put_A , OUTPUT);
pinMode(Put_B , OUTPUT);
pinMode(Put_C , OUTPUT);
pinMode(Put_D , OUTPUT);
pinMode(Put_E , OUTPUT);
pinMode(Put_F , OUTPUT);
pinMode(Put_G , OUTPUT);
pinMode(Put_H , OUTPUT);
pinMode(Reli , OUTPUT);
pinMode(Reli1 , OUTPUT);
pinMode(Hane1 , OUTPUT);
pinMode(Hane2 , OUTPUT);
pinMode(Hane3 , OUTPUT);
pinMode(Hane4 , OUTPUT);}
void loop()
{ tengshek=analogRead(1);
asti=analogRead(2);
usti=analogRead(3);
ter = analogRead(termo);
temp = ter * 4.8876;
if(temp/10>chong)
digitalWrite(Reli , LOW);
else digitalWrite(Reli , HIGH);
if(temp/10
digitalWrite(Reli1 , LOW);
else digitalWrite(Reli1 , HIGH);
if (tengshek>900)
{delay(20);
halet++;
if (halet==3)
halet=0;};
if (usti>900)
{delay(100);
if(halet==1)
chong++;
else if(halet==2)
kichik++; };
if (asti>900)
{delay(100);
if(halet==1)
chong--;
else if(halet==2)
kichik--; };
switch(halet)
{case 0:
Korsitish(0 , 12); //H
delay(3);
Korsitish(1 , temp/100%10);
delay(3);
Korsitish(2 , temp/10%10);
delay(3);
Korsitish(3 , temp%10);
delay(3);
break;
case 1:
Korsitish(0 , 11); //U
delay(3);
Korsitish(1 , 13); //-
delay(3);
Korsitish(2 , chong/10%10);
delay(3);
Korsitish(3 , chong%10);
delay(3);
break;
case 2:
Korsitish(0 , 10); //A
delay(3);
Korsitish(1 , 13); //-
delay(3);
Korsitish(2 , kichik/10%10);
delay(3);
Korsitish(3 , kichik%10);
delay(3);
break;}}
void Korsitish(int Hane , int reqem)
{ digitalWrite(Put_A , LOW);
digitalWrite(Put_B , LOW);
digitalWrite(Put_C , LOW);
digitalWrite(Put_D , LOW);
digitalWrite(Put_E , LOW);
digitalWrite(Put_F , LOW);
digitalWrite(Put_G , LOW);
digitalWrite(Put_H , LOW);
digitalWrite(Hane1 , hane_jedwel[Hane][0]);
digitalWrite(Hane2 , hane_jedwel[Hane][1]);
digitalWrite(Hane3 , hane_jedwel[Hane][2]);
digitalWrite(Hane4 , hane_jedwel[Hane][3]);
digitalWrite(Put_A , jedwel[reqem][0]);
digitalWrite(Put_B , jedwel[reqem][1]);
digitalWrite(Put_C , jedwel[reqem][2]);
digitalWrite(Put_D , jedwel[reqem][3]);
digitalWrite(Put_E , jedwel[reqem][4]);
digitalWrite(Put_F , jedwel[reqem][5]);
digitalWrite(Put_G , jedwel[reqem][6]);
if(halet==0&&Hane==2)
digitalWrite(Put_H , HIGH);
else digitalWrite(Put_H , LOW);}