This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/AnalogInput
No int sensorPin = A8 e onde de conecta o micro phone para se comunicar com o
jarvis, neste caso para teste só para ligar o led.
*/
int sensorPin = A8; // select the input pin for the potentiometer
int ledPin = 26; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
}
void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
// turn the ledPin on
digitalWrite(ledPin, HIGH);
// stop the program for
delay(sensorValue);
// turn the ledPin off:
digitalWrite(ledPin, LOW);
// stop the program for for
delay(sensorValue);
}
0 comments:
Postar um comentário