Magnet sensor sweep code

ok so i said piss on it and i ordered the arduino branded name board, the uno. this script should work on it then. thanks for your help guys. appreciated.