Devices & Components
Arduino Uno Rev3
Jumper wires (generic)
Hall sensor module
Project description
Code
Hall_Sensor_WellTronic
c_cpp
1//**********************************************************************************************************// 2// Author: 3// WellTronic 4// 5// Description: 6// This code is part of a video series covering all Arduino sensors from the Arduino sensor kit. 7// One of the sensors in this video series is the Hall sensor. 8// 9// In this video I will explain step by step how to use the Hall sensor 10// https://www.youtube.com/watch?v=hV8mqPxEAUY 11// 12// You're also welcome to take a look at the YouTube channel for more details about hardware and software. 13// https://www.youtube.com/channel/UC0UCNqE8i4unG8nfuakd0vw 14// 15// Enjoy working with this sensor and see you soon :) ! 16// 17//**********************************************************************************************************// 18 19int hallSensorPin = 4; 20int hallSensorValue = 0; 21 22void setup() { 23 // put your setup code here, to run once: 24Serial.begin(9600); 25pinMode(hallSensorPin,INPUT); 26} 27 28void loop() { 29 // put your main code here, to run repeatedly: 30 31hallSensorValue = digitalRead(hallSensorPin); 32Serial.print("hallSensorValue: "); 33Serial.println(hallSensorValue); 34 35} 36
Hall_Sensor_WellTronic
c_cpp
1//**********************************************************************************************************// 2// 3 Author: 4// WellTronic 5// 6// Description: 7// This code is part of a 8 video series covering all Arduino sensors from the Arduino sensor kit. 9// One 10 of the sensors in this video series is the Hall sensor. 11// 12// In this video 13 I will explain step by step how to use the Hall sensor 14// https://www.youtube.com/watch?v=hV8mqPxEAUY 15// 16// 17 You're also welcome to take a look at the YouTube channel for more details about 18 hardware and software. 19// https://www.youtube.com/channel/UC0UCNqE8i4unG8nfuakd0vw 20// 21 22// Enjoy working with this sensor and see you soon :) ! 23// 24//**********************************************************************************************************// 25 26int 27 hallSensorPin = 4; 28int hallSensorValue = 0; 29 30void setup() { 31 // put 32 your setup code here, to run once: 33Serial.begin(9600); 34pinMode(hallSensorPin,INPUT); 35} 36 37void 38 loop() { 39 // put your main code here, to run repeatedly: 40 41hallSensorValue 42 = digitalRead(hallSensorPin); 43Serial.print("hallSensorValue: "); 44Serial.println(hallSensorValue); 45 46} 47
Downloadable files
Schematics
Schematics
Comments
Only logged in users can leave comments