Installation manual and usage instructions
Step 1 – connecting the changeover reed switch 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 changeover reed switch’s features as documented in the API below.
intbrickobotik shield: changeover reed switch
In order to use the changeover reed switch you have to initialize it
from brickobotik import ChangeoverReedSwitch
# initializing the changeover reed switch at port A
my_switch = ChangeoverReedSwitch(‚A‘)
Provides the current state of the magnetic switch.
Returns 1 if the last detected magnetic pole was a north pole and
0 if it was a south pole.
if my_switch.get_state() == 1:
print(‚State of switch: N‘)
print(‚State of switch: S‘)
Returns True if orientation matches the orientation of the magnetic
field detected most recently, else False.
The parameter orientation has to be one of the values ‚NORTH‘, ‚N‘,
1, ‚SOUTH‘, ‚S‘, 0.
print(‚South pole detected recently!‘)
The program waits until the switch changes its state and then
returns the new state in the same manner as get_state().
# do something, for example, start a motor
# do something, for example, stop a motor