I need a little help with a canvas

i need a little help with a canvas
now i have a ball sprite how can i make it move th the direction the device is tilting to how can i do this