Joy-it SEN-MAG25N User guide

www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
1. GENERAL INFORMATION
Dear costumer,
thank you very much for choosing our product. In following, we will introduce you to what to observe while starting up
and using this product. Should you encounter any unexpected problems during use, please do
not hesitate to contact us.
ELECTRO MAGNET MODULE
SEN-MAG25N
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
2. COMMISSIONING WITH THE RASPBERRY PI
Wiring:
Raspberry Pi MAG25N
GND (Pin 6, 14, 9...) G
3V (Pin 1, 17) V
- NC
GPIO17 (Pin 11) SIG
Code example: In the following code example the magnet is activated every 5 seconds for 2.5 seconds.
from time import sleep import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
try:
while True: GPIO.output(23, GPIO.HIGH) sleep(2.5)
GPIO.output(23, GPIO.LOW)
sleep(2.5)
except KeyboardInterrupt:
GPIO.cleanup()
Loading...
+ 2 hidden pages