Professional Documents
Culture Documents
float val=0.0;
#include <LiquidCrystal.h>
void setup() {
pinMode(motor,OUTPUT);
lcd.begin(16, 2);
lcd.print("hello, world!");
lcd.setCursor(0, 0);
lcd.print("MOTOR PROJECT");
}
void loop() {
val=analogRead(temp);
val=val*4.887; // convert raw data into millivolts
val=val/10.0; // converting millivolts into deg C
lcd.setCursor(0, 1);
lcd.print("TEMP: ");
lcd.print(val);
if(val>=75)
analogWrite(motor,255); // 100% duty cycle