Installation manual and usage instructions

Step 1 – connecting the reed sensor to the hub

1a – Use a Torx T6 screwdriver to remove the two screws on the back of the LEGO® SPIKEPrime ultrasonic sensor. Then remove the white part.

1b – Insert the brickobotik shield and screw the Torx T6 screws back in.

Step 2 – getting the brickobotik library

2a – Open Google Chrome Browser on your PC or Laptop.

2b – Connect the LEGO® SPIKE Prime to the USB port of your device.

2c – If the LEGO® Education SPIKEapplication is running on your device, please close it.

2d – Use the brickobotik library tool to download our library onto your hub.

Step 3 – using the brickobotik shield

3a – In the LEGO® Education SPIKEApp use python for writing your program. You can now use all of the reed sensor’s features as documented in the API below.

This shield’s source API

brickobotik shield: reed sensor

    In order to use the reed sensor you have to initialize it first.

    Example:

        from brickobotik import ReedSensor

        # initializing the reed sensor at port A
        my_reed = ReedSensor(‚A‘)

 

bool magnetic_field_nearby()

    Checks whether there is a magnetic field near the reed sensor and returns True or False.

    Example:

        # search for a magnetic field and print out the result
        if my_reed.magnetic_field_nearby():
            print(‚Magnetic field detected!‘)
        else:
            print(‚No magnetic field detected!‘)

 

wait_for_magnetic_field()

    The program waits until the sensor detects a magnetic field.

    Example:

        my_reed.wait_for_magnetic_field()
        # do something, for example, lock a door