(HDAT) Initial motionsensor code