B4R Question Mega analog-pin pull up

Mostez

Well-Known Member
Licensed User
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?

B4X:
DoorOpenButton.Initialize(62,DoorOpenButton.MODE_INPUT_PULLUP) 'A8
    DoorSensor.Initialize(63,DoorSensor.MODE_INPUT_PULLUP) 'A9
    DoorOpenButton.AddListener("DoorOpenButton_Changed")
    DoorSensor.AddListener("DoorSensor_Changed")

B4X:
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
 

Mostez

Well-Known Member
Licensed User
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
Top