int med = A0; float temp; int motorPin = 5; int verde = 2; int amarelo = 3; int vermelho = 4; int val=0; void setup() { Serial.begin(9600); pinMode(verde, OUTPUT); pinMode(amarelo, OUTPUT); pinMode(vermelho, OUTPUT); pinMode(motorPin, OUTPUT); analogWrite(motorPin, 0); } //Funo que ser executada continuamente void loop() { temp = Arduino Uno R3 (float(analogRead(med))*5/(1023))/0.01; if ( temp <25){ Arduino U1 1 The official Arduino digitalWrite(verde, HIGH); digitalWrite(amarelo, LOW); Uno R3 Uno Rev3 digitalWrite(vermelho, LOW); } else if( (temp >=25)&&(temp <=38)){ digitalWrite(verde, LOW); digitalWrite(amarelo, HIGH); digitalWrite(vermelho, LOW); }else if(temp > 38){ digitalWrite(verde, LOW); digitalWrite(amarelo, LOW); digitalWrite(vermelho, HIGH); } analogWrite(motorPin, temp); Serial.print("Temperatura: "); Serial.println(temp); delay(500); } code U3 1 Temp Temperature Sensor Sensor 3- [LM35] pin TO-92 R1, 5 Resistor Resist the R2010 1 kohm R2, flow of electrical R3, energy in a circuit, R4, changing the voltage R5 and current as a result. LED A type of diode that illuminates when electricity Q62902- 650 yellow[["green","Green"],["yellow","Yellow"], D2 1 passes through it. B152 ["orange","Orange"],["blue","Blue"],["red","Red"]] Unlike an RGB Led, this one has a defined color. LED A type of diode that illuminates when electricity Q62902- 650 red[["green","Green"],["yellow","Yellow"], D1 1 passes through it. B152 ["orange","Orange"],["blue","Blue"],["red","Red"]] Unlike an RGB Led, this one has a defined color. LED A type of diode that illuminates when electricity Q62902- 650 green[["green","Green"],["yellow","Yellow"], D3 1 passes through it. B152 ["orange","Orange"],["blue","Blue"],["red","Red"]] Unlike an RGB Led, this one has a defined color. DC Motor This is the DC Motor from the DFRobot Kit. The PCB footprint Motor has two holes, each Connector M2 1 2mm in diameter 2.5mm with 4mm copper holes rings which make this easy to solder wires to. pMOS Transistor (MOSFET) Used for amplifying or switching electronic T1 1 signals. This type of TO220 MOSFET needs a negative voltage on the gate terminal to conduct. Cdigo:
int med = A0;
float temp; int motorPin = 5; int verde = 2; int amarelo = 3; int vermelho = 4; int val=0; void setup() {