There is provided a device comprising a blood pressure sensor for sensing blood pressure and a method for controlling the device. An angle of the device with respect to the direction of gravity is determined (202) and a location of one or more features of the user holding the device is identified (204). A height of the blood pressure sensor relative to a heart level of the user is determined based on the determined angle of the device with respect to the direction of gravity and the identified location of the one or more features of the user (206). The device is controlled based on the determined height of the blood pressure sensor relative to the heart level of the user (208).