YourESP32 Sketch HallEffectSensor

From ArduinoInfo
Jump to navigation Jump to search

/* YourESP32 Example: Sketch : read built-in Hall Effect Sensor
 *  SEE: https://ESP32Info.Info
 - WHAT IT DOES
// Simple sketch to access the internal hall effect detector on the esp32.
// values can be quite low. Maybe 25. Goes high/lower with nearby magnet.
// Brian Degger / @sctv 
 - SEE the comments after "//" on each line below
 - CONNECTIONS:
   - 
   - 
 - V1.00 10/02/2018
   Questions: terry@yourduino.com */

/*-----( Declare Variables )-----*/
int val = 0;


void setup()   /****** SETUP: RUNS ONCE ******/
{
Serial.begin(115200);

}//--(end setup )---


void loop()   /****** LOOP: RUNS CONSTANTLY ******/
{
val = hallRead();   // read hall effect sensor value
Serial.println(val); // print the results to the serial monitor
delay(1000);

}//--(end main loop )---

/*-----( Declare User-written Functions )-----*/
//NONE yet

//*********( THE END )***********