• Subscribe to motion events, for example ~>

    let handler = function(e) { 
    let {acceleration, rotationRate} = e ;
    let {x,y,z} = acceleration ;
    let {alpha, beta, gamma} = rotationRate ;
    console.log(`x,y,z,alpha,beta,gamma=${x},${y},${z},${alpha},${beta},${gamma}`)
    }
    //now we use the function
    subscribe_to_motion('unique_id', handler)

    Parameters

    • id: string
    • handler: ((e: any) => any)
        • (e): any
        • Parameters

          • e: any

          Returns any

    Returns void