, , ,

Módulo sensor magnético para Arduino Keyestudio

REF: KS0020


Este é um sensor de indução magnética que deteta os materiais magnéticos dentro de um alcance até 3 cm. A força do campo magnético e a o alcance de detação são proporcionais. O output é digital. Este módulo utiliza o sensor de campo magnético SFE REed Switch.

1,95 IVA INCL.

Módulo sensor magnético para Arduino Keyestudio

Sensing magnetic materials
Detection range: up to 3cm
Output: digital on/off
Detection range and magnetic field strength are proportional
Size: 30*20mm
Weight: 3g

Marca

int ledPin = 13;                // choose the pin for the LED
int inputPin = 3;               // Connect sensor to input pin 3 
int val = 0;                    // variable for reading the pin status
 
void setup() {
  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);     // declare pushbutton as input
}
 
void loop(){
  val = digitalRead(inputPin);  // read input value
  if (val == HIGH) {            // check if the input is HIGH
    digitalWrite(ledPin, LOW);  // turn LED OFF
  } else {
    digitalWrite(ledPin, HIGH); // turn LED ON
  }
}

 

 


			

Também pode gostar…