quinta-feira, 16 de março de 2017

Interface JARVIS simples com ARDUINO

/*

 Controlando LED pelo valor captado de um microfone

 */

int sensorPin = A8;    // pin MIC
int ledPin = 26;      // select the pin for the LED
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
 
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  // turn the ledPin on
  Serial.println(sensorValue);
  if ( sensorValue == 253 )
  delay(sensorValue);
  digitalWrite(ledPin, HIGH);
  delay(5000);
   digitalWrite(ledPin, LOW);
  // stop the program for milliseconds:
 
  // turn the ledPin off:
  digitalWrite(ledPin, LOW);
  // stop the program for for milliseconds:
  delay(sensorValue);
}

0 comments:

Postar um comentário


Caso queria ajudar nosso projeto... Fique à vontade !!!


EBOOKS

Translate | Tradutor

Deseja anunciar aqui. Fale comigo !!!

Nome

E-mail *

Mensagem *

Tecnologia do Blogger.

Popular Posts

Arquivo