




KS0036
Nuevo
Módulo Sensor de fuego para ARDUINO. Marca Keyestudio.
Este sensor de llama se puede utilizar para detectar incendios u otras luces cuya longitud de onda se encuentra en 760 nm ~ 1100 nm. En el juego de robots de lucha contra incendios, la llama juega un papel importante en la sonda, que puede utilizarse como los ojos del robot para encontrar la fuente de fuego.
const int flamePin = 2; // the number of the flame pin const int ledPin = 13; // the number of the LED pin // variables will change: int State = 0; // variable for reading status void setup() { // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(flamePin, INPUT); } void loop(){ // read the state of the value: State = digitalRead(flamePin); if (State == HIGH) { // turn LED on: digitalWrite(ledPin, HIGH); } else { // turn LED off: digitalWrite(ledPin, LOW); }