Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Geschrieben

Hallo zusammen,

 

ich bin ein großer Fan des Tinkerforge Baukastensystems. Außerdem programmiere ich fast ausschließlich in C#. Leider finde ich die C# API nicht besonders komfortabel, was wie ich denke auf die vielen Methoden mit „out“-Parametren zurückzuführen ist. Microsoft bzw. das C# Team haben das erkannt und mit .net 4.7 und C# Version 7 (Windows 10 Creators Update) das Problem behoben.

 

Daher möchte ich nun hier meine C# Plugin für .net 4.7 vorstellen. Diese Erweiterung fügt für alle Methoden aus der Tinkerfoge API für .net eine Methoden-Überschreibung hinzu. Es handelt sich um keine neue API sondern um eine API-Erweiterung. Es wird weiterhin die Basis-DLL benötigt.

 

Beispiel für C#:

 

var ipcon = new IPConnection(); // Create IP connection
var io = new BrickletIO4("h2R", ipcon); // Create device object
ipcon.Connect("localhost", 4223); // Connect to brickd

//Old Style
io.GetMonoflop(0, out byte value, out long time, out long timeRemaining);
Console.WriteLine("Remaining time: " + timeRemaining);

//New Style            
Console.WriteLine("Remaining time: " + io.GetMonoflop(0).TimeRemaining);
            
ipcon.Disconnect();
Console.WriteLine("Press enter to exit...");
Console.ReadKey();

 

Beispiel VB.net:

 

Dim ipcon = New IPConnection
Dim io = New BrickletIO4("h2R", ipcon) ' Create device object
ipcon.Connect("localhost", 4223) ' Connect to brickd

'Old Style
Dim value As Byte
Dim time As Long
Dim timeRemaining As Long
io.GetMonoflop(0, value:=value, time:=time, timeRemaining:=timeRemaining)
Console.WriteLine("Remaining time: " + timeRemaining.ToString())

'New Style            
Console.WriteLine("Remaining time: " + io.GetMonoflop(0).TimeRemaining.ToString())


ipcon.Disconnect()
Console.WriteLine("Press enter to exit...")
Console.ReadKey()

 

Ich kenne mich leider mit Mono nicht aus, daher kann ich nicht sagen, ob das kompatibel ist.

 

Fragen und Kommentare sind willkommen! :)

TinkerforgeNetPlus47.zip

TinkerforgeNetPlus47.dll

  • 2 weeks later...
  • 2 weeks later...
Geschrieben

Gehe ich richtig in der Annahme, dass man dafür jetzt zwingend Visual Studio 2017 benötigt?

Ich habe die 2015er Community-Version, habe auch das .net-Framework 4.7 installiert (Betriebssystem ist Windows 7) aber ich kann das Zielframework nicht auf die Version 4.7 ändern. Es wird in der Dropdownliste nicht angezeigt.

Geschrieben

Hallo Fabio,

 

danke für Deine Antwort.

Ich habe das .Net-Framework 4.7 ja bereits installiert, aber es steht mir für eine Auswahl dennoch nicht zur Verfügung.

 

Danke Dir dennoch!

Geschrieben

Habs auch endlich hinbekommen. Gibt für den Download nochmal eine Auswahl für welche VisualStudio Version man es herunterladen will. Da hatte ich offensichtlich nicht das richtige.

  • 2 months later...
  • 6 months later...
Geschrieben

Vielleicht kann TF einen hinweis in der Doku zu dieser Erweiterung hinterlegen

  • 3 weeks later...
Geschrieben
  • Autor

Update 1.3

Unterstützung für folgende Bricklet´s wurde ergänzt:

 

-Remote Switch Bricklet 2.0

-Motion Detector Bricklet 2.0

-Analog In Bricklet 3.0

-NFC Bricklet

-Temperature IR Bricklet 2.0

-Rotary Encoder Bricklet 2.0

-Solid State Relay Bricklet 2.0

-Outdoor Weather Bricklet

-DMX Bricklet, Humidity Bricklet 2.0

-Motorized Linear Poti Bricklet

-RGB LED Button Bricklet

-RGB LED Matrix Bricklet

-Thermal Imaging Bricklet

 

  • 10 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.