mirror of
				https://github.com/0xFEEDC0DE64/arduino-esp32.git
				synced 2025-11-04 08:01:38 +01:00 
			
		
		
		
	
		
			
	
	
		
			17 lines
		
	
	
		
			381 B
		
	
	
	
		
			Arduino
		
	
	
	
	
	
		
		
			
		
	
	
			17 lines
		
	
	
		
			381 B
		
	
	
	
		
			Arduino
		
	
	
	
	
	
| 
								 | 
							
								//Simple sketch to access the internal hall effect detector on the esp32.
							 | 
						||
| 
								 | 
							
								//values can be quite low. 
							 | 
						||
| 
								 | 
							
								//Brian Degger / @sctv  
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								int val = 0;
							 | 
						||
| 
								 | 
							
								void setup() {
							 | 
						||
| 
								 | 
							
								  Serial.begin(9600);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								void loop() {
							 | 
						||
| 
								 | 
							
								  // put your main code here, to run repeatedly:
							 | 
						||
| 
								 | 
							
								  val = hallRead();
							 | 
						||
| 
								 | 
							
								  // print the results to the serial monitor:
							 | 
						||
| 
								 | 
							
								  //Serial.print("sensor = ");
							 | 
						||
| 
								 | 
							
								  Serial.println(val);//to graph 
							 | 
						||
| 
								 | 
							
								}
							 |