Most simple and fast:
In the IDE-menu: Edit-> Copy for Forum ( or press ctrl+shift+C on your keyboard ) and paste into your post - that's it.
I'm sorry, it's Instagram I don't want/have - I get the two confused all the time.
Yeah, I use WhatsApp all the time.
Family, mostly.
Hi, @wajehulhassan
You do not need to post links to post your code.
PLEASE READ!!! this link;
It will show you how to post code in a scrolling window.
If you want help, you came to this forum for it, now use it, please....
It sounds as if you need a quick solution, is this a school class assignment/project?
Thanks.. Tom....
@wajehulhassan ,
I have removed your personal contact details from your posts. Please do not put that kind of information in the forum.
Thank you.
The problem in your initial post is caused by using the wrong LiquidCrystal_I2C library. Unfortunately there are several libraries with identical names, so other than trying different libraries the easiest solution is to look at the example code from the library you have and adapt the code to it. In future projects, use the hd44780 library by Bill Perry, available in the IDE library manager, it is currently supported and one of the best lcd libraries.
Arduino: 1.8.16 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
WARNING: library TimerOne claims to run on avr architecture(s) and may be incompatible with your current board which runs on esp8266 architecture(s).
C:\Users\ibrah\Downloads\Final incubator file by eee Wolf\incubator\incubator.ino: In function 'void initialisation()':
incubator:189:5: error: 'class LiquidCrystal_I2C' has no member named 'init'
189 | lcd.init();
| ^~~~
C:\Users\ibrah\Downloads\Final incubator file by eee Wolf\incubator\incubator.ino: In function 'void setup()':
incubator:337:10: error: 'class TimerOne' has no member named 'initialize'
337 | Timer1.initialize(1000000);
| ^~~~~~~~~~
incubator:338:10: error: 'class TimerOne' has no member named 'attachInterrupt'
338 | Timer1.attachInterrupt(blinkLED); // blinkLED to run every 0.15 seconds
| ^~~~~~~~~~~~~~~
Multiple libraries were found for "DHT.h"
Used: C:\Users\ibrah\OneDrive\Documents\Arduino\libraries\DHT_sensor_library
Not used: C:\Users\ibrah\OneDrive\Documents\Arduino\libraries\Grove_Temperature_And_Humidity_Sensor
Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: C:\Users\ibrah\OneDrive\Documents\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master
Not used: C:\Users\ibrah\OneDrive\Documents\Arduino\libraries\LiquidCrystal_I2C
exit status 1
'class LiquidCrystal_I2C' has no member named 'init'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
#include <Arduino.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
#include <LiquidCrystal_I2C.h>
#include <EEPROM.h>
#include "RTClib.h"
#include <TimerOne.h>
#define DHTPIN 5
#define DHTTYPE DHT22 // DHT 22 (AM2302)
#define MENUBUTTON 4
#define RIGHTBUTTON 3
#define LEFTBUTTON 2
#define FANPIN 8
#define HEATERPIN 6
#define ALARMPIN 11
#define HUMIDIFIERPIN 7
#define NOTPRESSED 1
#define PRESSED 0
#define MOTORLEFTPIN 9
#define MOTORRIGHTPIN 10
int firstuploaddetector=5;
int firstuploaddetectoraddress=200;
short const reftempaddress = 0;
short const refhumidaddress = 10;
short const reftemptoladdress = 20;
short const refhumidtoladdress = 30;
short const tspinaddress = 40;
short const NoINCUBATIONDAYSaddress = 50;
short const reftemptresholdaddress = 60;
short const refhumidtresholddadress = 70;
short const Noincubationdaysleftaddress =80;
short const motordirectionaddress = 33;
bool motordirection = 0;
String slogan = "Make life easier!";
short int spinaddress = 55;
short const startdayyearaddress= 81;
short const startdaymonthaddress=82;
short const startdaydayaddress=83;
short const startdayhouraddress=84;
short const startdayminuteaddress=85;
short const startdaysecondaddress = 86;
int timeduringrotation = 1;
int timeduringrotationaddress = 100;
float REFTEMPERATURE = 35.6;
float REFHUMIDITY = 40.5;
float REFTEMPTOLERANCE = 0.1;
float REFHUMIDTOLERANCE = 2.0;
float REFTEMPTRESHOLD = 0.3;
float REFHUMIDTRESHOLD =3;
unsigned short TSPIN = 2;
unsigned short NoINCUBATIONDAYS = 21;
unsigned short NoINCUBATIONDAYSLEFT = 21;
bool millisflag = 1;
unsigned short MINUTESPIN = 59;
unsigned short SECSPIN =59;
unsigned short SPIN =2;
unsigned short SPINHOLDER =2;
float REFTEMPERATUREHOLDER ;
float REFHUMIDITYHOLDER ;
float REFTEMPTOLERANCEHOLDER ;
float REFHUMIDTOLERANCEHOLDER ;
float REFTEMPTRESHOLDHOLDER ;
float REFHUMIDTRESHOLDHOLDER;
unsigned short TSPINHOLDER ;
int NoINCUBATIONDAYSHOLDER ;
unsigned short NoINCUBATIONDAYSLEFTHOLDER;
int timeduringrotationholder;
unsigned int a = 2003;
unsigned short b = 0;
unsigned short c = 0;
unsigned short d = 0;
unsigned short e= 0;
unsigned short f= 0;
unsigned long count,count1;
bool Home=1;
float humidity;
float temperature;
DateTime now, endday;
byte customChar[] = {
B00100,
B00100,
B01110,
B10001,
B10001,
B10001,
B01110,
B00100
};
byte customChar1[] = {
B00100,
B00100,
B01110,
B11111,
B11111,
B11111,
B01110,
B00100
};
byte arrow[8] = {
0b01000,
0b01100,
0b01110,
0b01111,
0b01110,
0b01100,
0b01000,
0b00000
};
RTC_DS1307 rtc;
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
DHT dht(DHTPIN, DHTTYPE);
/*
int b = EEPROM.read(startdaymonthaddress) ;
int c = EEPROM.read(startdaydayaddress);
int d = EEPROM.read(startdayhouraddress);
int e= EEPROM.read(startdayminuteaddress);
int f= EEPROM.read(startdaysecondaddress);
int a = EEPROM.read(startdayyearaddress) /* +1791 */
// DateTime startday (EEPROM.read(startdayyearaddress), EEPROM.read(startdaymonthaddress), EEPROM.read(startdaydayaddress), EEPROM.read(startdayhouraddress), EEPROM.read(startdayminuteaddress), EEPROM.read(startdaysecondaddress));
//DateTime startday(a,b,c,d,e,f);
void initialisation(void)
{
digitalWrite(MOTORLEFTPIN,LOW);
digitalWrite(MOTORRIGHTPIN,LOW);
rtc.begin();
now = rtc.now();
dht.begin();
lcd.init();
lcd.backlight();
lcd.setCursor(1, 0);
lcd.print("***** N W E *****");
lcd.setCursor(4, 1);
lcd.print("EGG INCUBATOR");
lcd.setCursor(0, 2);
lcd.print(" +923249381499 ");
delay(3000);
lcd.setCursor(1, 3);
for (int i = 0; i < 17; i++)
{
lcd.setCursor(i + 1, 3);
lcd.print(slogan[i]);
delay(3000);
}
/* lcd.setCursor(7,0);
lcd.print("_EGG_");
lcd.setCursor(3,1);
lcd.print("_INCUBATOR by_");
lcd.setCursor(0,2);
lcd.print("AFRIKGENIE industries"); */
delay(20);
firstuploaddetector= EEPROM.read(firstuploaddetectoraddress);
delay(20);
if(firstuploaddetector==255)
{
EEPROM.write(firstuploaddetectoraddress,10);
delay(20);
EEPROM.put(reftempaddress,REFTEMPERATURE);
delay(20);
EEPROM.put(reftemptoladdress,REFTEMPTOLERANCE);
delay(20);
EEPROM.put(refhumidaddress,REFHUMIDITY);
delay(20);
EEPROM.put(refhumidtoladdress,refhumidtoladdress);
delay(20);
EEPROM.put(reftemptresholdaddress,REFTEMPTRESHOLD);
delay(20);
EEPROM.put(refhumidtresholddadress,REFHUMIDTRESHOLD);
delay(20);
EEPROM.write(NoINCUBATIONDAYSaddress,NoINCUBATIONDAYS);
delay(20);
EEPROM.write(tspinaddress,TSPIN);
delay(20);
EEPROM.write(spinaddress, SPIN);
delay(20);
EEPROM.write(Noincubationdaysleftaddress,NoINCUBATIONDAYSLEFT);
delay(20);
EEPROM.write(tspinaddress,2);
delay(20);
EEPROM.write(timeduringrotationaddress,timeduringrotation);
}
// should be uncumented after first upload
delay(20);
EEPROM.get(reftempaddress,REFTEMPERATURE);
delay(20);
EEPROM.get(reftemptoladdress,REFTEMPTOLERANCE);
delay(20);
EEPROM.get(refhumidaddress,REFHUMIDITY);
delay(20);
EEPROM.get(refhumidtoladdress,refhumidtoladdress);
delay(20);
EEPROM.get(reftemptresholdaddress,REFTEMPTRESHOLD);
delay(20);
EEPROM.get(refhumidtresholddadress,REFHUMIDTRESHOLD);
delay(20);
NoINCUBATIONDAYS = EEPROM.read(NoINCUBATIONDAYSaddress);
delay(20);
TSPIN = EEPROM.read(tspinaddress);
delay(20);
SPIN = EEPROM.read(spinaddress);
delay(20);
timeduringrotation = EEPROM.read(timeduringrotationaddress);
delay(20);
NoINCUBATIONDAYSLEFT = EEPROM.read(Noincubationdaysleftaddress);
delay(20);
lcd.clear();
}
void blinkLED(void)
{
if(SECSPIN>0)
SECSPIN = SECSPIN -1;
}
void setup()
{
pinMode(MENUBUTTON, INPUT_PULLUP);
pinMode(RIGHTBUTTON,INPUT_PULLUP);
pinMode(LEFTBUTTON,INPUT_PULLUP);
pinMode(FANPIN,OUTPUT);
pinMode(HEATERPIN,OUTPUT);
pinMode(ALARMPIN,OUTPUT);
pinMode(MOTORLEFTPIN,OUTPUT);
pinMode(MOTORRIGHTPIN,OUTPUT);
pinMode(HUMIDIFIERPIN,OUTPUT);
initialisation();
lcd.createChar(0,customChar);
lcd.createChar(1,customChar1);
lcd.createChar(10,arrow);
a = EEPROM.read(startdayyearaddress) + 1792 ;
delay(20);
b = EEPROM.read(startdaymonthaddress) ;
delay(20);
c = EEPROM.read(startdaydayaddress);
delay(20);
d = EEPROM.read(startdayhouraddress);
delay(20);
e= EEPROM.read(startdayminuteaddress);
delay(20);
f= EEPROM.read(startdaysecondaddress);
delay(20);
//DateTime startday(a,b,c,d,e,f);
delay(20);
DateTime startday(2021,7,5,2,48,0);
//startday = startday + TimeSpan(-1,-1,0,0);
Timer1.initialize(1000000);
Timer1.attachInterrupt(blinkLED); // blinkLED to run every 0.15 seconds
Serial.begin(9600);
}
void readtempandhumid(void)
{
temperature = dht.readTemperature();
humidity = dht.readHumidity();
lcd.setCursor(6,0);
lcd.print(temperature);
lcd.setCursor(7,1);
lcd.print(humidity);
}
void alarm(){
digitalWrite(ALARMPIN,HIGH);
delay(100);
digitalWrite(ALARMPIN,LOW);
delay(40);
}
void savechanges(void)
{
delay(20);
EEPROM.put(reftempaddress,REFTEMPERATURE);
delay(20);
EEPROM.put(reftemptoladdress,REFTEMPTOLERANCE);
delay(20);
EEPROM.put(refhumidaddress,REFHUMIDITY);
delay(20);
EEPROM.put(refhumidtoladdress,refhumidtoladdress);
delay(20);
EEPROM.put(reftemptresholdaddress,REFTEMPTRESHOLD);
delay(20);
EEPROM.put(refhumidtresholddadress,REFHUMIDTRESHOLD);
delay(20);
EEPROM.write(NoINCUBATIONDAYSaddress,NoINCUBATIONDAYS);
delay(20);
NoINCUBATIONDAYSLEFT = NoINCUBATIONDAYS;
delay(20);
EEPROM.write(Noincubationdaysleftaddress,NoINCUBATIONDAYSLEFT);
delay(20);
DateTime startday(a,b,c,d,e,f);
startday = rtc.now();
EEPROM.write(startdayyearaddress,startday.year());
delay(20);
EEPROM.write(startdaymonthaddress,startday.month());
delay(20);
EEPROM.write(startdaydayaddress,startday.day());
delay(20);
EEPROM.write(startdayhouraddress,startday.hour());
delay(20);
EEPROM.write(startdayminuteaddress,startday.minute());
delay(20);
EEPROM.write(startdaysecondaddress,startday.second());
delay(20);
EEPROM.write(tspinaddress,TSPIN);
delay(20);
EEPROM.write(timeduringrotationaddress,timeduringrotation);
delay(20);
SPIN = TSPIN -1;
delay(20);
EEPROM.write(spinaddress,SPIN);
delay(20);
a = EEPROM.read(startdayyearaddress) + 1792 ;
delay(20);
b = EEPROM.read(startdaymonthaddress) ;
delay(20);
c = EEPROM.read(startdaydayaddress);
delay(20);
d = EEPROM.read(startdayhouraddress);
delay(20);
e= EEPROM.read(startdayminuteaddress);
delay(20);
f= EEPROM.read(startdaysecondaddress);
delay(20);
timeduringrotationaddress =timeduringrotation;
if(TSPIN)
{SECSPIN = 59;
}
}
void temperatureregulation(void)
{
if (temperature==REFTEMPERATURE)
{
digitalWrite(FANPIN,LOW);
digitalWrite(HEATERPIN,LOW);
}
else if ( (temperature>=(REFTEMPERATURE-REFTEMPTOLERANCE))&& (temperature<=(REFTEMPERATURE+REFTEMPTOLERANCE)) )
{
digitalWrite(FANPIN,LOW);
digitalWrite(HEATERPIN,LOW);
lcd.setCursor(16,0);
lcd.write(0);
}
readtempandhumid();
if (temperature>(REFTEMPERATURE+REFTEMPTOLERANCE))
{
digitalWrite(FANPIN,HIGH);
digitalWrite(HEATERPIN,LOW);
if(temperature>=(REFTEMPERATURE+REFTEMPTOLERANCE+REFTEMPTRESHOLD))
{
digitalWrite(ALARMPIN,HIGH);
lcd.setCursor(16,0);
lcd.write(1);
delay(100);
digitalWrite(ALARMPIN,LOW);
lcd.setCursor(16,0);
lcd.print(" ");
delay(150);
}
lcd.setCursor(16,0);
lcd.write(1);
}
readtempandhumid();
if (temperature<(REFTEMPERATURE - REFTEMPTOLERANCE))
{
digitalWrite(FANPIN,LOW);
digitalWrite(HEATERPIN,HIGH);
if(temperature<=(REFTEMPERATURE - REFTEMPTOLERANCE - REFTEMPTRESHOLD))
{
alarm();
lcd.setCursor(16,0);
lcd.write(1);
delay(100);
lcd.setCursor(16,0);
lcd.print(" ");
delay(100);
}
lcd.setCursor(16,0);
lcd.write(1);
}
}
void humidityregulation(){
if ( (humidity>=(REFHUMIDITY-REFHUMIDTOLERANCE))&& (humidity<=(REFHUMIDITY+REFHUMIDTOLERANCE)) )
{
digitalWrite(HUMIDIFIERPIN,LOW);
lcd.setCursor(16,1);
lcd.write(0);
}
readtempandhumid();
if (humidity>(REFHUMIDITY+REFHUMIDTOLERANCE))
{
digitalWrite(HUMIDIFIERPIN,LOW);
if(humidity>=(REFHUMIDITY+REFHUMIDTOLERANCE+REFHUMIDTRESHOLD))
{
alarm();
lcd.setCursor(16,1);
lcd.write(1);
delay(100);
lcd.setCursor(16,1);
lcd.print(" ");
delay(100);
}
lcd.setCursor(16,1);
lcd.write(1);
}
readtempandhumid();
if (humidity<(REFHUMIDITY - REFHUMIDTOLERANCE))
{
digitalWrite(HUMIDIFIERPIN,HIGH);
if(humidity<=(REFHUMIDITY - REFHUMIDTOLERANCE - REFHUMIDTRESHOLD))
{
alarm();
lcd.setCursor(16,1);
lcd.write(1);
delay(100);
alarm();
lcd.setCursor(16,1);
lcd.print(" ");
delay(100);
}
}
}
void milsecdelay(){
if (millisflag){
millisflag=0;
count =millis();
}
count1=millis();
if ((count1-count)>=50)
{
// action
millisflag=1;
}
}
void discardchanges()
{
REFTEMPERATURE = REFTEMPERATUREHOLDER;
REFHUMIDITY = REFHUMIDITYHOLDER;
REFTEMPTOLERANCE = REFTEMPTOLERANCEHOLDER ;
REFHUMIDTOLERANCE = REFHUMIDTOLERANCEHOLDER ;
REFTEMPTRESHOLD = REFTEMPTRESHOLDHOLDER ;
REFHUMIDTRESHOLD = REFHUMIDTRESHOLDHOLDER ;
TSPIN = TSPINHOLDER;
SPIN =SPINHOLDER;
NoINCUBATIONDAYS = NoINCUBATIONDAYSHOLDER ;
NoINCUBATIONDAYSLEFT = NoINCUBATIONDAYSLEFTHOLDER;
timeduringrotation= timeduringrotationholder;
}
void menu(void)
{
//entering menu
lcd.clear();
lcd.setCursor(3,0);
lcd.print("Entering MENU");
lcd.setCursor(4,1);
lcd.print("Please Wait...");
REFTEMPERATUREHOLDER = REFTEMPERATURE ;
REFHUMIDITYHOLDER = REFHUMIDITY;
REFTEMPTOLERANCEHOLDER = REFTEMPTOLERANCE;
REFHUMIDTOLERANCEHOLDER = REFHUMIDTOLERANCE ;
REFTEMPTRESHOLDHOLDER = REFTEMPTRESHOLD;
REFHUMIDTRESHOLDHOLDER = REFHUMIDTRESHOLD ;
TSPINHOLDER = TSPIN ;
NoINCUBATIONDAYSHOLDER = NoINCUBATIONDAYS;
NoINCUBATIONDAYSLEFTHOLDER = NoINCUBATIONDAYSLEFT;
SPINHOLDER = SPIN;
timeduringrotationholder= timeduringrotation;
delay(200);
lcd.clear();
do{
lcd.setCursor(4,1);
lcd.print("=>");// special select item character
lcd.setCursor(1,0);
lcd.print("Set Temperature:");
lcd.setCursor(6,1);
lcd.print(REFTEMPERATURE);
lcd.setCursor(10,1);
lcd.print((char) 223);
lcd.setCursor(11,1);
lcd.print("C");
lcd.setCursor(2,2);
lcd.print("Temp Tolerance:");
lcd.setCursor(6,3);
lcd.print(REFTEMPTOLERANCE);
lcd.setCursor(10,3);
lcd.print((char) 223);
lcd.setCursor(11,3);
lcd.print("C");
if ((digitalRead(RIGHTBUTTON)==PRESSED)&&(REFTEMPERATURE<99))
{
REFTEMPERATURE = REFTEMPERATURE + 0.1;
delay(200);
}
if ((digitalRead(LEFTBUTTON)==PRESSED)&&(REFTEMPERATURE>2))
{
REFTEMPERATURE = REFTEMPERATURE - 0.1;
delay(200);
}
} while(digitalRead(MENUBUTTON)== NOTPRESSED);
do{
}while (digitalRead(MENUBUTTON)==PRESSED);// debouncing of the menubutton pressing
lcd.setCursor(4,1);
lcd.print(" ");// special select item character removal
// selecting the reference temperature tolerance for editing
do{
lcd.setCursor(4,3);
lcd.print("=>");// special select item character
if ((digitalRead(RIGHTBUTTON)==PRESSED)&&(REFTEMPTOLERANCE<5))
{
REFTEMPTOLERANCE = REFTEMPTOLERANCE + 0.1;
delay(200);
}
if ((digitalRead(LEFTBUTTON)==PRESSED)&&(REFTEMPTOLERANCE>0))
{
REFTEMPTOLERANCE = REFTEMPTOLERANCE - 0.1;
delay(200);
}
//display of reference humdity
lcd.setCursor(2,2);
lcd.print("Temp Tolerance:");
lcd.setCursor(6,3);
lcd.print(REFTEMPTOLERANCE);
lcd.setCursor(10,3);
lcd.print((char) 223);
lcd.setCursor(11,3);
lcd.print("C");
} while (digitalRead(MENUBUTTON)==NOTPRESSED);
do{
}while (digitalRead(MENUBUTTON)==PRESSED);
lcd.clear();
do{
// display and selection of reference humidity for editing
lcd.setCursor(4,1);
lcd.print("=>");// special select item character
lcd.setCursor(3,0);
lcd.print("Set Humidity:");
lcd.setCursor(6,1);
lcd.print(REFHUMIDITY);
lcd.setCursor(11,1);
lcd.print("% RH");
//display of reference humdity
lcd.setCursor(1,2);
lcd.print("Humidity Tolerance:");
lcd.setCursor(6,3);
lcd.print(REFHUMIDTOLERANCE);
lcd.setCursor(10,3);
lcd.print("% RH");
if ((digitalRead(RIGHTBUTTON)==PRESSED)&&(REFHUMIDITY<99))
{
REFHUMIDITY = REFHUMIDITY + 0.1;
delay(200);
}
if ((digitalRead(LEFTBUTTON)==PRESSED)&&(REFHUMIDITY>5))
{
REFHUMIDITY = REFHUMIDITY - 0.1;
delay(200);
}
} while(digitalRead(MENUBUTTON)== NOTPRESSED);
do{
}while (digitalRead(MENUBUTTON)==PRESSED);// debouncing of the menubutton pressing
lcd.setCursor(4,1);
lcd.print(" ");// special select item character removal
// selecting the reference humidity tolerance for editing
do{
lcd.setCursor(4,3);
lcd.print("=>");// special select item character
if (digitalRead(RIGHTBUTTON)==PRESSED)
{
REFHUMIDTOLERANCE = REFHUMIDTOLERANCE + 0.1;
delay(200);
}
if (digitalRead(LEFTBUTTON)==PRESSED)
{
REFHUMIDTOLERANCE = REFHUMIDTOLERANCE- 0.1;
delay(200);
}
//display of reference humdity
lcd.setCursor(1,2);
lcd.print("Humidity Tolerance:");
lcd.setCursor(6,3);
lcd.print(REFHUMIDTOLERANCE);
lcd.setCursor(10,3);
lcd.print("% RH");
} while (digitalRead(MENUBUTTON)==NOTPRESSED);
do{
}while (digitalRead(MENUBUTTON)==PRESSED);
lcd.clear();
do{
// display and selection of reference temprature for editing
lcd.setCursor(4,1);
lcd.print("=>");// special select item character
lcd.setCursor(1,0);
lcd.print("Temp_Diff Treshold:");
lcd.setCursor(6,1);
lcd.print(REFTEMPTRESHOLD);
lcd.setCursor(10,1);
lcd.print((char) 223);
lcd.setCursor(11,1);
lcd.print("C");
// display and selection of reference humidity
lcd.setCursor(0,2);
lcd.print("Humid_Diff Treshold:");
lcd.setCursor(6,3);
lcd.print(REFHUMIDTRESHOLD);
lcd.setCursor(10,3);
lcd.print("% RH");
if (digitalRead(RIGHTBUTTON)==PRESSED)
{
REFTEMPTRESHOLD = REFTEMPTRESHOLD + 0.1;
delay(200);
}
if (digitalRead(LEFTBUTTON)==PRESSED)
{
REFTEMPTRESHOLD = REFTEMPTRESHOLD - 0.1;
delay(200);
}
} while(digitalRead(MENUBUTTON)== NOTPRESSED);
do{
}while (digitalRead(MENUBUTTON)==PRESSED);// debouncing of the menubutton pressing
lcd.setCursor(4,1);
lcd.print(" ");// special select item character removal
do{
// display and selection of reference humidity for editing
lcd.setCursor(4,3);
lcd.print("=>");// special select item character
lcd.setCursor(0,2);
lcd.setCursor(0,2);
lcd.print("Humid_Diff Treshold:");
lcd.setCursor(6,3);
lcd.print(REFHUMIDTRESHOLD);
lcd.setCursor(10,3);
lcd.print("% RH");
if (digitalRead(RIGHTBUTTON)==PRESSED)
{
REFHUMIDTRESHOLD = REFHUMIDTRESHOLD+ 0.1;
delay(200);
}
if (digitalRead(LEFTBUTTON)==PRESSED)
{
REFHUMIDTRESHOLD = REFHUMIDTRESHOLD - 0.1;
delay(200);
}
} while(digitalRead(MENUBUTTON)== NOTPRESSED);
do{
} while (digitalRead(MENUBUTTON)==PRESSED);// debouncing of the menubutton pressing
lcd.clear();
do{
if(NoINCUBATIONDAYS>50)
{
NoINCUBATIONDAYS=21;
}
// display of incubation time in days
lcd.setCursor(4,2);
lcd.print("=>");
lcd.setCursor(0,0);
lcd.print("Set Incubation_Time:");
lcd.setCursor(6,2);
lcd.print(NoINCUBATIONDAYS);
lcd.setCursor(9,2);
lcd.print("Days");
if ((digitalRead(RIGHTBUTTON)==PRESSED)&&(NoINCUBATIONDAYS<46))
{
NoINCUBATIONDAYS = NoINCUBATIONDAYS + 1;
delay(200);
}
if ((digitalRead(LEFTBUTTON)==PRESSED)&&(REFTEMPERATURE>1))
{
NoINCUBATIONDAYS = NoINCUBATIONDAYS - 1;
delay(200);
}
if (NoINCUBATIONDAYS<10){
lcd.setCursor(7,2);
lcd.print(" ");
}
}while (digitalRead(MENUBUTTON)==NOTPRESSED);
do{
}while (digitalRead(MENUBUTTON)==PRESSED);
lcd.clear();
do{
// display of incubation time in days
lcd.setCursor(4,2);
lcd.print("=>");
lcd.setCursor(0,0);
lcd.print("Time Between Spins:");
lcd.setCursor(6,2);
lcd.print(TSPIN );
lcd.setCursor(9,2);
lcd.print("Hour/s");
if ((digitalRead(RIGHTBUTTON)==PRESSED) && (TSPIN <13) )
{
TSPIN = TSPIN + 1;
delay(100);
}
if ((digitalRead(LEFTBUTTON)==PRESSED) && (TSPIN >=1) )
{
TSPIN = TSPIN - 1;
delay(100);
}
if (TSPIN<10){
lcd.setCursor(7,2);
lcd.print(" ");
}
}while (digitalRead(MENUBUTTON)==NOTPRESSED);
do{
}while (digitalRead(MENUBUTTON)==PRESSED);
lcd.clear();
do{
lcd.setCursor(4,2);
lcd.print("=>");
lcd.setCursor(0,0);
lcd.print("Time During Rot.");
lcd.setCursor(6,2);
lcd.print(timeduringrotation);
lcd.setCursor(8,2);
lcd.print("s");
if(timeduringrotation<10)
{
lcd.setCursor(7,2);
lcd.print(" ");
}
if ((digitalRead(RIGHTBUTTON)==PRESSED)&& (timeduringrotation<100))
{
timeduringrotation = timeduringrotation+ 1;
delay(200);
if(timeduringrotation<10)
{
lcd.setCursor(7,2);
lcd.print(" ");
}
}
if ((digitalRead(LEFTBUTTON)==PRESSED)&& (timeduringrotation>1))
{
timeduringrotation = timeduringrotation - 1;
delay(200);
lcd.setCursor(7,2);
lcd.print(" ");
}
} while(digitalRead(MENUBUTTON)== NOTPRESSED);
do{
}while (digitalRead(MENUBUTTON)==PRESSED);
lcd.clear();
do{
lcd.setCursor(0,0);
lcd.print(" Press 'Ok' to save");
lcd.setCursor(2,1);
lcd.print(" Changes or any");
lcd.setCursor(0,2);
lcd.print("Other key to discard");
}while ( (digitalRead(MENUBUTTON)==NOTPRESSED) && (digitalRead(RIGHTBUTTON)==NOTPRESSED) && (digitalRead(LEFTBUTTON)==NOTPRESSED));
if(!digitalRead(MENUBUTTON))
{lcd.clear();
savechanges();
/* lcd.setCursor(0,0);
lcd.print("saved");
delay(300); */
lcd.clear();
lcd.setCursor(4, 0);
lcd.print("SAVING...");
lcd.setCursor(3, 3);
for (int i = 0; i < 17; i++)
{
lcd.setCursor(i + 1, 1);
lcd.write(byte(10));
lcd.setCursor(i + 1, 2);
lcd.write(byte(10));
delay(60);
}
lcd.clear();
lcd.setCursor(0, 1);
lcd.print("SAVED SUCCESSFULLY!!");
delay(500);
}
else{
lcd.clear();
discardchanges();
lcd.setCursor(0,0);
lcd.print("changes discarded");
delay(300);
}
lcd.clear();
}
void loop()
{
now= rtc.now();
/*
lcd.setCursor(0,2);
lcd.print(now.year());
lcd.setCursor(4,2);
lcd.print('/');
lcd.setCursor(5,2);
lcd.print(now.month());
lcd.setCursor(9,2);
lcd.print('/');
lcd.setCursor(10,2);
lcd.print(now.day(), DEC);
lcd.setCursor(12,2);
*/
//lcd.setCursor(,);
//lcd.print(daysOfTheWeek[now.dayOfTheWeek()]);
// lcd.setCursor(,);
// lcd.print(") ");
/* lcd.print(now.hour());
lcd.setCursor(14,3);
lcd.print(':');
lcd.setCursor(15,2);
lcd.print(now.minute());
lcd.setCursor(16,3);
lcd.print(':');
lcd.setCursor(17,2);
lcd.print(now.second());
*/
lcd.setCursor(15,2);
lcd.print(SECSPIN);
lcd.setCursor(0,0);
lcd.print("TEMP= ");
lcd.setCursor(6,0);
lcd.print(temperature);
lcd.setCursor(12,0);
lcd.print((char) 223);
lcd.setCursor(13,0);
lcd.print("C");
lcd.setCursor(0,1);
lcd.print("HUMID= ");
lcd.setCursor(7,1);
lcd.print(humidity);
lcd.setCursor(13,1);
lcd.print("%");
if (TSPIN==0){
lcd.setCursor(0,2);
lcd.print("T_Spin =");
lcd.setCursor(9,2);
lcd.print("00");
lcd.setCursor(11,2);
lcd.print(":");
lcd.setCursor(12,2);
lcd.print("00");
lcd.setCursor(14,2);
lcd.print(":");
lcd.setCursor(15,2);
lcd.print("00");
}
else{
lcd.setCursor(0,2);
lcd.print("T_Spin =");
lcd.setCursor(9,2);
lcd.print(SPIN);
lcd.setCursor(11,2);
lcd.print(":");
lcd.setCursor(12,2);
lcd.print(MINUTESPIN);
lcd.setCursor(14,2);
lcd.print(":");
lcd.setCursor(15,2);
lcd.print(SECSPIN);
}
lcd.setCursor(0,3);
lcd.print("HATCH IN = ");
lcd.setCursor(11,3);
lcd.print(NoINCUBATIONDAYSLEFT);
if (NoINCUBATIONDAYSLEFT<10){
lcd.setCursor(12,3);
lcd.print(" ");
}
lcd.setCursor(14,3);
lcd.print("Days");
lcd.setCursor(15,2);
lcd.print(SECSPIN);
if(SECSPIN<10)
lcd.setCursor(16,2);
lcd.print(" ");
if(MINUTESPIN<10)
lcd.setCursor(13,2);
lcd.print(" ");
if(SPIN<10){
lcd.setCursor(10,2);
lcd.print(" ");
}
if ((SECSPIN==0)&& MINUTESPIN)
{
MINUTESPIN = MINUTESPIN - 1;
SECSPIN = 59;
}
if ((MINUTESPIN==0)&& SPIN)
{
SPIN = SPIN - 1;
MINUTESPIN = 59;
}
if((SPIN ==0) && (MINUTESPIN==0) && (SECSPIN==0))
{
delay(20);
motordirection = EEPROM.read(motordirectionaddress);
delay(20);
if(motordirection){
motordirection=0;
delay(20);
EEPROM.write(motordirectionaddress,motordirection);
delay(20);
lcd.clear();
lcd.setCursor(0,1);
lcd.print(" MOTOR ROTATION ");
digitalWrite(MOTORLEFTPIN,LOW);
digitalWrite(MOTORRIGHTPIN,HIGH);
delay(1000);
digitalWrite(MOTORRIGHTPIN,LOW);
digitalWrite(MOTORLEFTPIN,LOW);
lcd.clear();
}
else{
motordirection=1;
delay(20);
EEPROM.write(motordirectionaddress,motordirection);
delay(20);
lcd.clear();
lcd.setCursor(0,1);
lcd.print(" MOTOR ROTATION ");
digitalWrite(MOTORRIGHTPIN,LOW);
digitalWrite(MOTORLEFTPIN,HIGH);
delay(timeduringrotation*1000);
digitalWrite(MOTORRIGHTPIN,LOW);
digitalWrite(MOTORLEFTPIN,LOW);
lcd.clear();
}
TSPIN= EEPROM.read(tspinaddress);
SPIN = TSPIN -1;
MINUTESPIN =59;
SECSPIN =59;
}
lcd.setCursor(15,2);
lcd.print(SECSPIN);
temperatureregulation();
humidityregulation ();
lcd.setCursor(15,2);
lcd.print(SECSPIN);
if (digitalRead(MENUBUTTON)==PRESSED)
{
menu();
}
lcd.setCursor(15,2);
lcd.print(SECSPIN);
if(NoINCUBATIONDAYSLEFT == 0)
{
alarm();
lcd.setCursor(0,3);
lcd.print(" ");
delay(10);
lcd.setCursor(0,3);
lcd.print("INCUB. TIME REACHED");
delay(500);
lcd.setCursor(0,3);
lcd.print(" ");
delay(10);
}
lcd.setCursor(15,2);
lcd.print(SECSPIN);
// lcd.setCursor(0,3);
//startday = startday + TimeSpan(1,1,1,1);
//lcd.print(" ");
//a = EEPROM.read(startdayyearaddress);
DateTime startday(a,b,c,d,e,f);
/* lcd.setCursor(0,3);
lcd.print(startday.second()); */
/* lcd.setCursor(15,2);
lcd.print(SECSPIN);
*/
delay(20);
/* this code below should be commented to stop the act
of using seconds as incubation days. Note: this was
made only for demonstration purposes in order to see how
effective the number of incubation days are being counted. */
for (unsigned short n=1; n<50; n++)
{ if (NoINCUBATIONDAYS >= n)
{ if (rtc.now() == ( startday + TimeSpan(0,0,0,n)))
{
NoINCUBATIONDAYSLEFT = NoINCUBATIONDAYS - n;
EEPROM.write(Noincubationdaysleftaddress,NoINCUBATIONDAYSLEFT);
delay(10);
}
}
}
/* should be uncommented in order to make the number of days of incubation effectif.
for (unsigned short n=1; n<50; n++)
{ if (NoINCUBATIONDAYS >= n)
{ if ((rtc.now() == ( startday + TimeSpan(n,0,0,0)))||(rtc.now() == ( startday + TimeSpan(n,0,30,0)))||(rtc.now() == ( startday + TimeSpan(n,1,0,0)))||(rtc.now() == ( startday + TimeSpan(n,2,0,0)))||(rtc.now() == ( startday + TimeSpan(n,5,0,0)))||(rtc.now() == ( startday + TimeSpan(n,10,0,0))))
{
NoINCUBATIONDAYSLEFT = NoINCUBATIONDAYS - n;
EEPROM.write(Noincubationdaysleftaddress,NoINCUBATIONDAYSLEFT);
delay(10);
}
}
}
}
How to solve these errors
This code is writtern for Arduino nano and i want to compile it for nodemcu
Compiler errors have nothing to do with Avrdude, stk500 or Bootloader.
You have already posted another topic about this; what's wrong with the answers in there. I've reported this as a crosspost.
That error looks awfully familiar. I suspect you've started cross-posting. That is not a good idea. Don't do that again.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.