It finally worked! Thanks! Now, I need to make it provide coordinates between 0 and 240 or 320... which I did using 'map'