Search this site
Embedded Files
Skip to main content
Skip to navigation
WALL-E
HOME
ABOUT US
OUR PROJECT
PROBLEM STATEMENT
MATERIALS
GRAPHIC DESIGN
ENGINEERING NOTEBOOK
team information
part
schedule
design inspiration
technical principle
problem and solution
functions
building step
appendix arduino codes
LEARNING JOURNEY
SELF REFLECTION
FUTURE PROJECT LEARNING
IMPACT OF THIS PROJECT
GALLERY
APPENDIX CODES
GUESS BOOK
WALL-E
HOME
ABOUT US
OUR PROJECT
PROBLEM STATEMENT
MATERIALS
GRAPHIC DESIGN
ENGINEERING NOTEBOOK
team information
part
schedule
design inspiration
technical principle
problem and solution
functions
building step
appendix arduino codes
LEARNING JOURNEY
SELF REFLECTION
FUTURE PROJECT LEARNING
IMPACT OF THIS PROJECT
GALLERY
APPENDIX CODES
GUESS BOOK
More
HOME
ABOUT US
OUR PROJECT
PROBLEM STATEMENT
MATERIALS
GRAPHIC DESIGN
ENGINEERING NOTEBOOK
team information
part
schedule
design inspiration
technical principle
problem and solution
functions
building step
appendix arduino codes
LEARNING JOURNEY
SELF REFLECTION
FUTURE PROJECT LEARNING
IMPACT OF THIS PROJECT
GALLERY
APPENDIX CODES
GUESS BOOK
APPENDIX
Arduino codes
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 5
#include <Servo.h>
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display
float Celcius = 0;
float Fahrenheit = 0;
Servo Door;
int openDoor = 180;
int closeDoor = 90;
int trigTemp = 33;
void setup()
{
lcd.init();
lcd.backlight();
sensors.begin();
delay(50);
Door.attach(3);
}
void loop() {
sensors.requestTemperatures();
Celcius = sensors.getTempCByIndex(0);
Fahrenheit = sensors.toFahrenheit(Celcius);
lcd.setCursor(2, 0);
lcd.print("Temp Celcius");
lcd.setCursor(5, 1);
lcd.print(Celcius);
if (Celcius > trigTemp){
Door.write(openDoor);
}
else if (Celcius <= trigTemp){
Door.write(closeDoor);
}
Google Sites
Report abuse
Page details
Page updated
Google Sites
Report abuse