M Mostez Well-Known Member Licensed User Longtime User Aug 2, 2017 #1 Hello, I want to use analog pins A8 and A9 on aruino Mega for digital input, I declared both pins in input pull up mode. A9 works ok, but I get no response at all from A8. any ideas? Code: Copy DoorOpenButton.Initialize(62,DoorOpenButton.MODE_INPUT_PULLUP) 'A8 DoorSensor.Initialize(63,DoorSensor.MODE_INPUT_PULLUP) 'A9 DoorOpenButton.AddListener("DoorOpenButton_Changed") DoorSensor.AddListener("DoorSensor_Changed") Code: Copy private Sub DoorOpenButton_Changed (Status As Boolean) Log (Status) 'no response at all If Status = False Then UnLockDoor End Sub private Sub DoorSensor_Changed (Status As Boolean) If Status = False Then DoorSensorON = True 'door opened Else DoorSensorON = False 'door closed LockDoor End If End Sub
Hello, I want to use analog pins A8 and A9 on aruino Mega for digital input, I declared both pins in input pull up mode. A9 works ok, but I get no response at all from A8. any ideas? Code: Copy DoorOpenButton.Initialize(62,DoorOpenButton.MODE_INPUT_PULLUP) 'A8 DoorSensor.Initialize(63,DoorSensor.MODE_INPUT_PULLUP) 'A9 DoorOpenButton.AddListener("DoorOpenButton_Changed") DoorSensor.AddListener("DoorSensor_Changed") Code: Copy private Sub DoorOpenButton_Changed (Status As Boolean) Log (Status) 'no response at all If Status = False Then UnLockDoor End Sub private Sub DoorSensor_Changed (Status As Boolean) If Status = False Then DoorSensorON = True 'door opened Else DoorSensorON = False 'door closed LockDoor End If End Sub
Erel B4X founder Staff member Licensed User Longtime User Aug 2, 2017 #2 Does it work with other pins (A7 for example)? Upvote 0
M Mostez Well-Known Member Licensed User Longtime User Aug 2, 2017 #3 it works with A14,A15, the problem is I have to reconfigure pins assignment again, i wonder if A8 has internal pull up! or damaged? Upvote 0
it works with A14,A15, the problem is I have to reconfigure pins assignment again, i wonder if A8 has internal pull up! or damaged?
Erel B4X founder Staff member Licensed User Longtime User Aug 3, 2017 #4 Based on the documentation all pins have an internal pull up resistor: https://www.arduino.cc/en/Main/arduinoBoardMega Upvote 0
Based on the documentation all pins have an internal pull up resistor: https://www.arduino.cc/en/Main/arduinoBoardMega
M Mostez Well-Known Member Licensed User Longtime User Aug 3, 2017 #5 thanks Erel, it seems that this pin is damaged Upvote 0