KY-003 |
Part Number | KY-003 |
Manufacturer | Joy-IT |
Description | 3 Hall Magnetic Field Sensor KY-003 Hall Magnetic Field Sensor TABLE OF CONTENTS 1. Overview 2. Pin-Assignment 3. Code Example Arduino 4. Code Example Raspberry Pi 5. Information and take-back obliga... |
Features |
l Magnetic Field Sensor
3. CODE EXAMPLE ARDUINO
This is an example program that lights up an LED when a signal is detected on the sensor. The KY-011, KY016 or KY-029 modules can also be used as LEDs, for example.
You can download the code example here, or copy the following example:
int Led = 13 ;// Declaration of the LED output pin int Sensor = 10; // Declaration of the sensor input pin int val; // Temporary Variable
void setup () {
pinMode (Led, OUTPUT) ; // Initialization of output pin pinMode (Sensor, INPUT) ; // Sensor pin initialization digitalWrite(Sensor, HIGH); // Activation of intern... |
Document |
KY-003 Data Sheet
PDF 372.03KB |
Similar Datasheet