Digital_magnetic_sensor_(SKU__DFR0033) - jimaobian/DFRobotWiki GitHub Wiki
The magnetic sensor can be used on magnetic (magnet) detection, detection range up to about 3cm (detection range and the strength of the magnetic).
- Voltage: +3.3-5V
- Pin Definition :1 - Output 2 - Power 3 - to
- Weight: 5g
#include <Wire.h>
int magPin=3;
void setup()
{
Serial.begin(9600);
Serial.println("magnet:");
pinMode(magPin,INPUT);
}
int val;
void loop()
{
val=digitalRead(magPin);
Serial.println(val);
}
shopping digital magnetic sensor (sku: dfr0033)
category: Product Manual category: DFR Series category: Sensors category:source category:Diagram