This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int led1 = 10; | |
int led2 = 11; | |
int led3 = 12; | |
int led4 = 13; | |
int estado1 = LOW; | |
int estado2 = LOW; | |
int estado3 = LOW; | |
int estado4 = LOW; | |
char leitura; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int led = 13; | |
void setup() { | |
pinMode(led, OUTPUT); | |
} | |
void loop() { | |
digitalWrite(led, HIGH); | |
delay(1000); | |
digitalWrite(led, LOW); | |
delay(1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LiquidCrystal.h> | |
int readSerial; | |
int Led = 13; | |
boolean estadoLed = false; | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); | |
void setup(){ | |
Serial.begin(9600); | |
pinMode(Led,OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int readBluetooth; | |
boolean stateDormitorio1=false; | |
boolean stateDormitorio2=false; | |
boolean stateDormitorio3=false; | |
boolean stateSala=false; | |
boolean stateBanheiro=false; | |
boolean stateCozinha=false; | |
boolean statePiscina=false; | |
boolean stateGaragem=false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int LDR = 0; | |
int ValorLido = 0; | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
ValorLido = analogRead(LDR); | |
Serial.print("Valor lido pelo LDR = "); | |
Serial.println(ValorLido); | |
delay(500); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int LDR = 0; | |
const int Led = 6; | |
int ValorLido = 0; | |
int pwm = 0; | |
void setup() { | |
pinMode(Led, OUTPUT); | |
} | |
void loop() { | |
ValorLido = analogRead(LDR); | |
if (ValorLido < 500){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
Servo motor; | |
void setup(){ | |
motor.attach(5); | |
} | |
void loop() | |
{ | |
int angle = analogRead(0); | |
angle=map(angle, 0, 1023, 0, 180); | |
motor.write(angle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int PinoPotenciometro = 0; | |
const int Led = 13; | |
int ValorPot = 0; | |
void setup() { | |
pinMode(Led, OUTPUT); | |
} | |
void loop() { | |
ValorPot = analogRead(PinoPotenciometro); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int PinoPotenciometro = 0; | |
const int Led = 13; | |
int ValorPot = 0; | |
void setup() { | |
pinMode(Led, OUTPUT); | |
} | |
void loop() { | |
ValorPot = analogRead(PinoPotenciometro); |