Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15287

Strange behavior using ESP32 and hall effect sensor

$
0
0

Hi all,
I have an ESP32 Wroom and when i try to plug a thumb throttle on pin 13 and a push button on pin 27 everithing work fine i succeed to read the hall value but when i press the button the signal of the hall is incorrect it pass to full (10 bit => 4095).
Do you have an explanation on what wrong with my code or my electrical schema? I tried to change the input mode as well but not working also. Every answer is appreciated.

pinMode(27, INPUT);

void loop()
{
   LectureEntree();
}

void LectureEntree()
{
  int sensorValue = 0;
  int i=0;
  for (i=0;i<=20;i++){
   sensorValue =  sensorValue + analogRead(13); 
  }
  throttleIn =(int)(sensorValue/20); 
  Serial.print("Signal of the hall: ");
  Serial.println(throttleIn);
}

VCC

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 15287

Trending Articles