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® SPIKE™ Prime 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 SPIKE™ application is running on your device, please close it.
2d – Use the brickobotik library tool to download our library onto your hub.
3a – In the LEGO® Education SPIKE™ App use python for writing your program. You can now use all of the reed sensor’s features as documented in the API below.
brickobotik shield: reed sensor
In order to use the reed sensor you have to initialize it first.
from brickobotik import ReedSensor
# initializing the reed sensor at port A
my_reed = ReedSensor(‚A‘)
Checks whether there is a magnetic field near the reed sensor and returns True or False.
# search for a magnetic field and print out the result
print(‚Magnetic field detected!‘)
print(‚No magnetic field detected!‘)
The program waits until the sensor detects a magnetic field.
# do something, for example, lock a door