def print_master(conn, settings, uid):
    from tinkerforge.brick_master import BrickMaster  # type: ignore[import] # pylint: disable=import-error,import-outside-toplevel
    br = BrickMaster(uid, conn)
    print_generic(
        settings,
        "master",
        br.get_identity(),
        1.0,
        "",
        br.get_stack_voltage(),
        br.get_stack_current(),
        br.get_chip_temperature(),
    )
Example #2
0
def print_master(conn, settings, uid):
    from tinkerforge.brick_master import BrickMaster  # type: ignore[import]
    br = BrickMaster(uid, conn)
    print_generic(
        settings,
        "master",
        br.get_identity(),
        1.0,
        "",
        br.get_stack_voltage(),
        br.get_stack_current(),
        br.get_chip_temperature(),
    )
Example #3
0
print >> sys.stderr, 'connecting to %s port %s' % server_address
sock.connect(server_address)

if __name__ == "__main__":

    ipcon = IPConnection()  # Create IP connection
    master = BrickMaster(UID, ipcon)  # Create device object
    a = BrickletAccelerometer(UIDa, ipcon)
    #dir = BrickletDistanceIR(UIDd, ipcon)
    dir = BrickletDistanceUS(UIDu, ipcon)
    ipcon.connect(HOST, PORT)  # Connect to brickd
    # Don't use device before ipcon is connected

    # Display master status and LED blink
    master.enable_status_led()
    print(master.get_identity())
    cc = 0
    # Get current stack voltage (unit is mV)
    try:

        while True:
            cc = cc + 1
            stack_voltage = master.get_stack_voltage()
            #print("Stack Voltage: " + str(stack_voltage/1000.0) + " V")

            # Get current stack current (unit is mA)
            stack_current = master.get_stack_current()
            #print("Stack Current: " + str(stack_current/1000.0) + " A")

            # get wifi status
            iswifi = master.is_wifi2_present()