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,

 

es gelingt mir nicht den Port eines IO16 abzufragen. Ich erhalte jedes Mal als Ergebnis "undefined". Das IO16 wird korrekt erkannt und ich kann es konfigurieren und schalten, nur eben nicht lesen.

 

if (deviceIdentifier == Tinkerforge.BrickletIO16.DEVICE_IDENTIFIER) {
  debug("Found IO16 with UID:" + uid);
  io16 = new Tinkerforge.BrickletIO16(uid, ipcon); // Create device object
  // Alle Pins an Port B auf Ausgang setzen (ausgeschaltet)
  io16.setPortConfiguration('b', 255, 'o', false);
  io16.setPort('b', 1);

  pins = io16.getPort('b');
  alert(pins); // bringt undefined"
}

 

Ich hoffe ihr könnt mir helfen :)

 

Gruß

gus484

Geschrieben

Getter in den JavaScript Bindings sind async. Du musst getPort so aufrufen:

 

// Get current value from port A as bitmask
io.getPort('a',
function (valueMask) {
	alert('Value Mask (Port A): ' + valueMask.toString(2));
},
function (error) {
	alert('Error: ' + error);
}
);

Geschrieben
  • Autor

Ok, danke :) Jetzt funktioniert es.

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.