{"action":"opened","issue":{"url":"https://api.github.com/repos/FelipeRLTI/Automation-house/issues/1","repository_url":"https://api.github.com/repos/FelipeRLTI/Automation-house","labels_url":"https://api.github.com/repos/FelipeRLTI/Automation-house/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/FelipeRLTI/Automation-house/issues/1/comments","events_url":"https://api.github.com/repos/FelipeRLTI/Automation-house/issues/1/events","html_url":"https://github.com/FelipeRLTI/Automation-house/issues/1","id":132768079,"number":1,"title":"Ilumination","user":{"login":"FelipeRLTI","id":17162963,"avatar_url":"https://avatars.githubusercontent.com/u/17162963?v=3","gravatar_id":"","url":"https://api.github.com/users/FelipeRLTI","html_url":"https://github.com/FelipeRLTI","followers_url":"https://api.github.com/users/FelipeRLTI/followers","following_url":"https://api.github.com/users/FelipeRLTI/following{/other_user}","gists_url":"https://api.github.com/users/FelipeRLTI/gists{/gist_id}","starred_url":"https://api.github.com/users/FelipeRLTI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FelipeRLTI/subscriptions","organizations_url":"https://api.github.com/users/FelipeRLTI/orgs","repos_url":"https://api.github.com/users/FelipeRLTI/repos","events_url":"https://api.github.com/users/FelipeRLTI/events{/privacy}","received_events_url":"https://api.github.com/users/FelipeRLTI/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-10T17:37:44Z","updated_at":"2016-02-10T17:37:44Z","closed_at":null,"body":"*\r\nProjeto automação Luzes\r\n*/\r\n// Configuração do sensor \r\nint sensor = 5;// Pino selecionado\r\n// Leitura do dados\r\nint valorSensor = 5; //Usado para ler o valor do sensor\r\nint cor = 0; // Dimerização\r\n\r\nconst int LED1 = 3;// Pino do led 1\r\nconst int LED2 = 5;// Pino do led 2\r\nconst int LED3 = 6;// Pino do led 3\r\nconst int LED4 = 9;// Pino do led 4\r\nconst int LED5 = 10;// Pino do led 5\r\nconst int LEDFUNC = 2;// Pino de funcionamento do sistema\r\n\r\n// função inicial\r\nvoid setup(){\r\n  Serial.begin(9600);// Ativa o serial de valores do led\r\n  pinMode(LED1, OUTPUT); //Saída do led1\r\n  pinMode(LED2, OUTPUT); //Saída do led2\r\n  pinMode(LED3, OUTPUT); //Saída do led3\r\n  pinMode(LED4, OUTPUT); //Saída do led4\r\n  pinMode(LED5, OUTPUT); //Saída do led5\r\n  pinMode(LEDFUNC, OUTPUT); //Saída do ledfunc\r\n}\r\n//Abertura do programa de automação\r\nvoid loop(){\r\n  int valorSensor = analogRead(sensor); //Leitura do sensor \r\n  analogWrite(LED1, cor); \r\n  analogWrite(LED2, cor);\r\n  analogWrite(LED3, cor);\r\n  analogWrite(LED4, cor);\r\n  analogWrite(LED5, cor);\r\n\r\n// Controle do sistema de automação  \r\n  if (valorSensor < 800){\r\n    cor = 0;\r\n    analogWrite(LED1, cor); \r\n    analogWrite(LED2, cor);\r\n    analogWrite(LED3, cor);\r\n    analogWrite(LED4, cor);\r\n    analogWrite(LED5, cor);\r\n    digitalWrite(LEDFUNC,LOW);\r\n    \r\n  }\r\n  if (valorSensor >= 800 && valorSensor <=1000){\r\n    cor = 40; // Intensidade da luz\r\n    // Intensidade da cor dos leds\r\n    analogWrite(LED1, cor); \r\n    analogWrite(LED2, cor);\r\n    analogWrite(LED3, cor);\r\n    analogWrite(LED4, cor);\r\n    analogWrite(LED5, cor);\r\n    digitalWrite(LEDFUNC, HIGH);\r\n  }\r\n  if (valorSensor >1000){\r\n    cor = 254; // Intensidade da luz\r\n    analogWrite(LED1, cor); \r\n    analogWrite(LED2, cor);\r\n    analogWrite(LED3, cor);\r\n    analogWrite(LED4, cor);\r\n    analogWrite(LED5, cor);\r\n    digitalWrite(LEDFUNC, HIGH); // Funcionamento\r\n  }\r\n  // Exibindo o valor do sensor no monitor\r\n  Serial.println(valorSensor);\r\n  delay(100);\r\n}"}}