Active Topics

 


Reply
Thread Tools
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#1
Hi,
does anybody know if the acceleration sensors of the N9 or the N900 are accurate enough to use them for measuring accelerations?
For example in one of my next physics lesson I want to measure the acceleration of a circular motion.
Here is a quick and dirty approach to measure the acceleration, if the N9 is fixed to the experiment with the dipsplay up or down.

Code:
import QtQuick 1.1
import QtMobility.sensors 1.1
import com.nokia.meego 1.0

Page {
    tools: commonTools
    property real a: 0

    function updateAcceltext(x,y){
     var a_new = Math.sqrt(x*x+y*y)
     if (a_new > a){
         a = (a_new/10*9.81).toFixed(2)
         txtAccelerometer.text = "Acceleration: \nX: " + a
        }
     }

    Accelerometer {
        id: accData
        active: true

        onReadingChanged: {
            updateAcceltext(reading.x,reading.y)
        }
    }

    Text {
        id: txtAccelerometer
        anchors.centerIn: parent
        text: "Accelerometer starting.."
        font.pointSize: 50
    }

}
Did I miss something?
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 10:30.