Hall effect - (part of rudder pedals for sum usage)

i got a hall effect wired onto VCC/Gnd/A9 on Arduino.

I can compile and deploy… but once I push the code, it deploys (successfully)… if I use a button to control a led as a test -> that works, even with the errors as per the log uploaded.

But when i deploy the code as per image, trying to read the hall effect, nothing…

I've even tried to adding a Serial.println("XXXX"); to just see it loop/print, nothing :wink:

G

stupid question, instead of the "XXX" how can I print the date/time...

.. this is a hall effect sensor that's used to pickup 2 pedal positions, part of a helicopter pedal setup, need to read position and transpose onto value 0 -> 1023

Please post your code using code tags, it is very hard to read. My Arduino does not have A9, which one are you using? Schematics are always better, even for something this simple.

sorry posted like that so that I could show 5 lines code and the associated error.

G


int hall_Sensor=A9;
int inputVal = 0;


void setup() {

  Serial.begin(9600); 

  // initialize the hall effect sensor pin as an input:
  pinMode(hall_Sensor,INPUT);    //Pin 2 is connected to the output of proximity sensor

}

void loop(){

  inputVal = analogRead(hall_Sensor);
  Serial.println(inputVal);
  delay(100);              // wait for a second

}

using a Pro micro.

G

and this is the pin out being used.

G

I've tried the following code connected to a pot and the same, I am expecting it to print something as it runs the loop..., got feeling problem is related to the error in red on the OP

int pot_Sensor=A8;
int inputVal = 0;


void setup() {

  Serial.begin(9600); 

  // initialize the hall effect sensor pin as an input:
  pinMode(pot_Sensor,INPUT);    //Pin 2 is connected to the output of proximity sensor

}

void loop(){

  inputVal = analogRead(pot_Sensor);
  Serial.println(inputVal);
  delay(100);              // wait for a second

}

ye... allot of times the problem is Pepkac... for those that know that, smile grin, for others... just ignore thread...

G

... solution => make sure to view serial monitor... and not just compile/deploy output tab.
on Arduino IDE tool... :wink:
G

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.