Exemplo n.º 1
0
 def _handle_led(self):
     # LED is on when any battery is being discharged
     any_enabled = False
     for dic in self.channels:
         if dic.get('enabled'):
             any_enabled = True
     self.dacq.getFeedback(u3.LED(State=any_enabled))
Exemplo n.º 2
0
def turnLEDon(d):
   d.getFeedback(u3.LED(State = True))
Exemplo n.º 3
0
def turnLEDoff(d):
   d.getFeedback(u3.LED(State = False))
Exemplo n.º 4
0
def LED(d,on_or_off = True):     #If on_or_off is True, then the LED will turn on.
   d.getFeedback(u3.LED(State = on_or_off))
Exemplo n.º 5
0
 def set_LED(self, state=1):
     self.u.getFeedback(u3.LED(State=state))
Exemplo n.º 6
0
	def __init__(self):
		if P.labjacking and P.labjack_available:
			self.labjack = u3.U3()
			self.labjack.configU3()
			self.labjack.getFeedback(u3.LED(State=False))
Exemplo n.º 7
0
#!/usr/bin/python
# LabJack demonstration
#
# Blink the U3's status LED until the AIN0 input exceeds a limit value.
#
# Source code from the book "Real World Instrumentation with Python"
# By J. M. Hughes, published by O'Reilly.

import u3
import time

u3d = u3.U3()

LEDoff = u3.LED(0)
LEDon = u3.LED(1)
AINcmd = u3.AIN(0, 31, False, False)

toggle = 0

while True:
    # blink the LED while looping
    if toggle == 0:
        u3d.getFeedback(LEDon)
        toggle = 1
    else:
        u3d.getFeedback(LEDoff)
        toggle = 0

    inval = u3d.getFeedback(AINcmd)[0]
    print inval
    if inval > 40000: