Jump to content

Tippel

Members
  • Gesamte Inhalte

    11
  • Benutzer seit

  • Letzter Besuch

Posts erstellt von Tippel

  1. Hallo,

     

    mein Anfang war sehr erfolgreich. Ausgepackt, angeschlossen, Brickd und Brickv installiert. Alles wunderbar.

     

    brickviewer.jpg

     

    Aber jetzt will ich über WAMP zugreifen und das geht nicht.

     

    <?php
    echo "Test 1<br>";
    require_once('../../../source/Tinkerforge/IPConnection.php');
    require_once('../../../source/Tinkerforge/BrickMaster.php');
    echo "Test 2<br>";
    
    use Tinkerforge\IPConnection;
    use Tinkerforge\BrickMaster;
    echo "Test 3<br>";
    
    $host = 'localhost';
    $port = 4223;
    
    $uid = '94wpecnBBF8'; // Change to your UID
    #$uid = 'ayNfRV5u9Vg'; // Change to your UID
    echo "Test 4 $host $port $uid<br>";
    
    $ipcon = new IPConnection($host, $port); // Create IP connection to brickd
    echo "Test 5.1<br>";
    $master = new BrickMaster($uid); // Create device object
    echo "Test 5.2<br>";
    
    $ipcon->addDevice($master); // Add device to IP connection
    // Don't use device before it is added to a connection
    echo "Test 6<br>";
    
    // Get voltage and current from stack (in mV/mA)
    $voltage = $master->getStackVoltage();
    $current = $master->getStackCurrent();
    echo "Test 7<br>";
    
    echo "Stack Voltage: " . $voltage / 1000.0 . " V\n";
    echo "Stack Current: " . $current / 1000.0 . " A\n";
    echo "Test 8<br>";
    
    echo "Press key to exit\n";
    fgetc(fopen('php://stdin', 'r'));
    $ipcon->destroy();
    
    ?>

     

    php1.jpg

     

    Leider baut er die Verbindung nicht auf. Was mache ich falsch?

     

    Danke

    Tippel

×
×
  • Neu erstellen...