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
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
}
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
}