- Milyen billentyűzetet vegyek?
- Nvidia GPU-k jövője - amit tudni vélünk
- Milyen egeret válasszak?
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- Azonnali notebookos kérdések órája
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- LG LCD és LED TV-k
- VR topik
- Projektor topic
-
PROHARDVER!
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
leventekov
csendes újonc
Sziasztok
Segitseget szeretnek kerni.egy lampat szeretnek megadott idore kapcsolni. Be es Ki
es egy gombot mikor nem villagit be lehessen kapcsolni es ugyan azzal ki./*
Akvárium vezérlés
*/
#include <Wire.h>
#include <LiquidCrystal.h>
//declare variables
float tempC;
float temp2C;
int tempPin = 1;
int temp2Pin = 2;int buttonPin = 10 ;
boolean currentState = LOW;//stroage for current button state
boolean lastState = LOW;//storage for last button state
boolean ledState = LOW;//storage for the current state of the LED (off/onint hour;
int minute;
int second;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);int co2Pin = 0; // co2 szelep
int regvilPin = 1; // reggeli villagita
int ledPin = 13; // ledszallag
int napalivilPin = 9; // napalivillagitas
int tap1Pin = 7; // tap 1 pumpa
int tap2Pin = 8; // tap 2 pumpa
int tap3Pin = 6; // tap 2 pumpavoid setup()
{lcd.begin(16, 4);
Wire.begin();
pinMode(co2Pin, OUTPUT);
digitalWrite(co2Pin, LOW);
digitalWrite(napalivilPin, LOW);
pinMode(napalivilPin,OUTPUT);
digitalWrite(regvilPin, LOW);
pinMode(regvilPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
pinMode(tap1Pin, OUTPUT);
digitalWrite (tap1Pin, LOW);
pinMode (tap2Pin, OUTPUT);
digitalWrite (tap2Pin, LOW);
pinMode (tap3Pin, OUTPUT);
digitalWrite (tap3Pin, LOW);pinMode(buttonPin, INPUT);//this time we will set the pin as INPUT
pinMode(ledPin, OUTPUT);
Serial.begin(9600);//initialize Serial connection}
void loop()
{Wire.beginTransmission(104);
Wire.write(0x00);
Wire.endTransmission();
Wire.requestFrom(104, 7);
second = Wire.read();
minute = Wire.read();
hour = Wire.read();
hour=hour/16 * 10 + hour % 16;
minute=minute/16 * 10 + minute % 16;
second=second/16 * 10 + second % 16;lcd.setCursor(1,0);
lcd.print("Time ");
lcd.print(hour);
lcd.print(":");
if (minute < 10) { lcd.print("0"); }
lcd.print(minute);
lcd.print(":");
if (second < 10) { lcd.print("0"); }
lcd.print(second);tempC = analogRead(tempPin); //read the value from the sensor
tempC = (5.0 * tempC * 100.0)/1024.0; //convert the analog data to temperature
temp2C = analogRead(temp2Pin); //read the value from the sensor
temp2C = (5.0 * temp2C * 100.0)/1024.0; //convert the analog data to temperature// print result to lcd display
lcd.setCursor(1,1);
lcd.print("Viz");
lcd.setCursor(10, 1);
lcd.print(tempC,1);
lcd.print("'C");lcd.setCursor(1,2);
lcd.print("Szoba");
lcd.setCursor(10, 2);
lcd.print(temp2C,1);
lcd.print("'C");
lcd.setCursor(1,3);
if (hour*60+minute >= 540 && hour*60+minute <=1020 ) // CO@ adagolas kiirasa 9:00 - 17:00
{lcd.print("CO2 ADAGOLAS");}
{
lcd.print("CO2 KIKAPCSOLT");
}
if (hour*60+minute >= 1020 and hour*60+minute <= 540)
//----------------------------------------------------------------------------------
//Tápoldat 1 adagolás 7:00:00-kor 5mpif (hour*360+minute*60+second >= 2520 and hour*360+minute*60+second <= 2522)
{digitalWrite (tap1Pin, HIGH);}
else
{digitalWrite (tap1Pin, LOW);}//----------------------------------------------------------------------------------
//Tápoldat 2 adagolás 7:00:10-kor 5mpif (hour*360+minute*60+second >= 2523 and hour*360+minute*60+second <= 2525)
{digitalWrite (tap2Pin, HIGH);}
else
{digitalWrite (tap2Pin, LOW);}//----------------------------------------------------------------------------------
//Tápoldat 3 adagolás 7:00:10-kor 5mpif (hour*360+minute*60+second >= 2526 and hour*360+minute*60+second <= 2528)
{digitalWrite (tap3Pin, HIGH);}
else
{digitalWrite (tap3Pin, LOW);}//-----------------------------------------------------------------------------------
//CO2 vezerles: Be: 09:00 Ki: 17:00if (hour*60+minute >= 540 && hour*60+minute <=1020 )
{digitalWrite (co2Pin, HIGH);}
else
{digitalWrite (co2Pin, LOW);}
//................................................................................
//Reggeli villagitas : Be: 11:00 Ki : 19:00if (hour*60+minute >= 660 && hour*60+minute <= 1140)
{digitalWrite (regvilPin, HIGH);}
else
{digitalWrite (regvilPin, LOW);}//--------------------------------------------------------------------------------
// Nappali Villagitase: 14:00 Ki: 16:00
if (hour*60+minute >= 840 && hour*60+minute <= 960)
{digitalWrite (napalivilPin, HIGH);}
else
{digitalWrite (napalivilPin, LOW);}//----------------------------------------------------------------
//................................................................................
//Esteji villagitas : Be: 11:00 Ki : 19:00if (hour*60+minute >= 660 && hour*60+minute <= 1140)
{digitalWrite (regvilPin, HIGH);}
else
{digitalWrite (regvilPin, LOW);}currentState = digitalRead(buttonPin);
if (currentState == HIGH && lastState == LOW){//if button has just been pressed
Serial.println("pressed");
delay(1);//crude form of button debouncing//toggle the state of the LED
if (ledState == HIGH){
digitalWrite(ledPin, LOW);
ledState = LOW;
} else {
digitalWrite(ledPin, HIGH);
ledState = HIGH;}
}
lastState = currentState;
}//
KB igy nez ki
Új hozzászólás Aktív témák
- Magyarország piacvezető szoftver webáruháza
- DOKKOLÓ BAZÁR! Lenovo, HP, DELL és egyéb más dokkolók (TELJES SZETTEK)
- 2db Dell PowerEdge R740 2U Rack Szerver és 3db Netapp FAS2040 NAS
- BESZÁMÍTÁS! Lenovo ThinkPad T14 Gen 4 üzleti notebook - i7 1360P 24GB DDR5 RAM 512GB SSD Iris Xe W11
- BESZÁMÍTÁS! MSI B550 R7 5700X 32GB DDR4 512GB SSD RTX 3060Ti 8GB Rampage SHIVA MSI 650W
Állásajánlatok
Cég: CAMERA-PRO Hungary Kft
Város: Budapest
Cég: PC Trade Systems Kft.
Város: Szeged