Skip to content

Instantly share code, notes, and snippets.

View nilsonpessim's full-sized avatar

Nilson Pessim nilsonpessim

View GitHub Profile
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;
#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);
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;
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);
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){
#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);
const int PinoPotenciometro = 0;
const int Led = 13;
int ValorPot = 0;
void setup() {
pinMode(Led, OUTPUT);
}
void loop() {
ValorPot = analogRead(PinoPotenciometro);
const int PinoPotenciometro = 0;
const int Led = 13;
int ValorPot = 0;
void setup() {
pinMode(Led, OUTPUT);
}
void loop() {
ValorPot = analogRead(PinoPotenciometro);
int ledPin = 13;
int Botao = 2;
int EstadoBotao = 0;
void setup(){
pinMode(ledPin, OUTPUT);
pinMode(Botao, INPUT);
}
void loop(){
EstadoBotao = digitalRead(Botao);
if (EstadoBotao == HIGH){