The following information is for the EMANT300, EMANT380

Turn on and off the LEDs Portwise

Learn:

  • Digital Output
  • LED

The Digital Port is written portwise ie 8 bits at a time. Both the EMANT300 and EMANT380 are run in the same program

WritePort_USB_BT.py

import emant import time m = emant.Emant300() m.Open("00:06:66:00:A1:D8",dev="380") ms = emant.Emant300() # Windows ms.Open("COM5",dev="300") # Ubuntu # ms.Open("/dev/ttyUSB0",dev="300") print m.HwId() print ms.HwId() count = 0 while count < 8: m.WriteDigitalPort(count) ms.WriteDigitalPort(7-count) count += 1 time.sleep(1) m.Close() ms.Close()

Code Explained

m = emant.Emant300() m.Open("00:06:66:00:A1:D8",dev="380")

Create a new instance of emant.Emant300(), assign to m and connect it to the EMANT380

ms = emant.Emant300() ms.Open("COM5",dev="300")

Create another instance of emant.Emant300(), assign to ms and connect it to the EMANT300

Python with EMANT380
| TOC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |