'''
 * Filename    : Hall sensor
 * Thonny      : Thonny 4.1.4
 * Auther      : http//www.keyestudio.com
'''
from machine import Pin
import time

hall = Pin(8, Pin.IN)
while True:
    value = hall.value()
    print(value, end=' ')
    if value == 0:
        print("A magnetic field")
    else:
        print("There is no magnetic field")
    time.sleep(0.1)