// int count = 0;
// void setup() {
// // put your setup code here, to run once:
// Serial.begin(9600);
// Serial.print("initial count: ");
// Serial.println(count);
// }
// void loop() {
// // put your main code here, to run repeatedly:
// if(count < 5){
// count++;
// Serial.print("new count: ");
// Serial.println(count);
// }
// }
// int battery = 10;
// void setup() {
// // put your setup code here, to run once:
// Serial.begin(9600);
// Serial.print("initial battery percentage: ");
// Serial.print(battery);
// Serial.println("%");
// }
// void loop() {
// // put your main code here, to run repeatedly:
// if(battery > 5){
// battery--;
// Serial.print("new battery percentage: ");
// Serial.print(battery);
// Serial.println("%");
// }
// }
// int brightness = 100;
// void setup() {
// // put your setup code here, to run once:
// Serial.begin(9600);
// Serial.print("initial brightness: ");
// Serial.println(brightness);
// Serial.println("increasing brightness...");
// brightness += 50;
// Serial.print("increased brightness: ");
// Serial.println(brightness);
// Serial.println("decreasing brightness...");
// brightness -= 30;
// Serial.print("decreased brightness: ");
// Serial.println(brightness);
// }
// void loop() {
// // put your main code here, to run repeatedly:
// }
// int maths = 80;
// int physics = 75;
// int chemistry = 90;
// void setup() {
// // put your setup code here, to run once:
// Serial.begin(9600);
// int total = maths + physics + chemistry;
// Serial.print("Total Scores: ");
// Serial.println(total);
// float avg = total/3;
// Serial.print("Avg Score: ");
// Serial.println(avg);
// }
// void loop() {
// // put your main code here, to run repeatedly:
// }
int temperature = 35;
int led = 13;
bool led_on = false;
int led2 = 7;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.print("Temperature is: ");
Serial.println(temperature);
pinMode(led, OUTPUT);
// Serial.println(temperature > 30);
// Serial.println(temperature < 20);
// Serial.println(temperature == 35);
}
// void loop() {
// // put your main code here, to run repeatedly:
// if(temperature > 30){
// Serial.println("temp is HIGH");
// digitalWrite(led2, LOW);
// digitalWrite(led, HIGH);
// temperature--;
// }else if(temperature <= 20){
// Serial.println("temp is LOW");
// digitalWrite(led, HIGH);
// temperature++;
// } else {
// Serial.println("temp is COOL");
// digitalWrite(led, LOW);
// digitalWrite(led2, HIGH);
// temperature--;
// }
// delay(2000);
// }
void loop() {
// put your main code here, to run repeatedly:
if(temperature > 32 || led_on){
Serial.println("temp is HIGH");
digitalWrite(led, HIGH);
digitalWrite(led2, LOW);
temperature--;
}else if(temperature != 35){
Serial.print("temp is:");
Serial.println(temperature);
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
if(temperature > 30){
temperature--;
}else {
temperature+=5;
}
} else {
Serial.println("temp is COOL");
digitalWrite(led2, HIGH);
digitalWrite(led, LOW);
temperature++;
}
delay(2000);
}
// int x = 10;
// int y = 5;
// int result = 2;
// void setup() {
// // put your setup code here, to run once:
// Serial.begin(9600);
// int total = x + y;
// result *= total;
// Serial.print("Answer: ");
// Serial.println(result);
// Serial.print("Answer greater than 20: ");
// Serial.println(result > 20);
// }
// void loop() {
// // put your main code here, to run repeatedly:
// }
// String name = "Rasik";
// int age = 18;
// int math_score = 80;
// int physics_score = 75;
// int chemistry_score = 90;
// void setup() {
// // put your setup code here, to run once:
// Serial.begin(9600);
// Serial.print("name: ");
// Serial.println(name);
// Serial.print("age: ");
// Serial.println(age);
// Serial.print("math score: ");
// Serial.println(math_score);
// Serial.print("physics score: ");
// Serial.println(physics_score);
// Serial.print("chemistry score: ");
// Serial.println(chemistry_score);
// int total = math_score + physics_score + chemistry_score;
// float avg = total/3;
// Serial.print("Total Scores: ");
// Serial.println(total);
// Serial.print("Avg Score: ");
// Serial.println(avg);
// Serial.print("Avg greater than or equal to 50: ");
// Serial.println(avg > 50 || avg == 50);
// Serial.println("increasing student's age for no reason...");
// age++;
// Serial.println("decreasing student's chemistry score for no reason...");
// chemistry_score -= 5;
// Serial.println();
// Serial.println();
// Serial.println();
// Serial.println("updated data is as follows: ");
// Serial.print("name: ");
// Serial.println(name);
// Serial.print("age: ");
// Serial.println(age);
// Serial.print("math score: ");
// Serial.println(math_score);
// Serial.print("physics score: ");
// Serial.println(physics_score);
// Serial.print("chemistry score: ");
// Serial.println(chemistry_score);
// total = math_score + physics_score + chemistry_score;
// avg = total/3;
// Serial.print("Total Scores: ");
// Serial.println(total);
// Serial.print("Avg Score: ");
// Serial.println(avg);
// Serial.print("Avg greater than or equal to 50: ");
// Serial.println(avg > 50 || avg == 50);
// }
// void loop() {
// // put your main code here, to run repeatedly:
// }