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,

 

ich habe mal eine Frage zum Interrupt beim Industrial Digital In 4 Bricklet mit PHP.

 

Aus der Doku geht folgendes hervor:

 

// Enable interrupt on pin 0
$idi4->setInterrupt(1 << 0);

 

setzte ich statt 0 die 15 um auf alle vier Eingänge eine Reaktion zu erhalten passiert nichts, wenn ich aber "1 << " wegfallen lasse funktioniert es.

 

Für was also ist das "1 << " zuständig? Irgendwie steh ich da auf dem Schlauch.

 

Gruß

Geschrieben

Meinst Du sowas?

$idi4->setInterrupt(1 << 15);

Das wird nicht geht, da hier das eine Bit um 15 Stellen geshiftet wird.

 

Du kannst sowas nutzen:

1 << 0  -> 1 shift um 0 Bits == 1

1 << 1  -> 1 shift um 1 Bits == 2

1 << 2  -> 1 shift um 2 Bits == 4

1 << 3  -> 1 shift um 4 Bits == 8

 

oder natürlich die Zahlen 1,2,4,8 und Summen davon verwenden.

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.