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.

[Java] LinearPoti / RotaryPoti (Unterschiedliche Types für gleiche Werte)

Featured Replies

Geschrieben

Frage zur API LinearPoti und RotaryPoti

 

Eigentlich ist das auf 'Programmierebene' ja 'das gleiche'.

Aber die beiden Methoden

 

@Override

public void position(xxx i) {

}

 

@Override

public void positionReached(xxx i) {

}

 

sind bei...

...LinearPoti xxx=int

...RotaryPoty xxx=short

 

Wäre da eine Harmonisierung denkbar?

 

Grüsse

 

Quantasy

 

 

 

Geschrieben

Der Wertebereich des Linear Poti ist 0 bis 100 abgebildet als uint16. Der Wertebereich des Rotaty Poti ist -150 bis +150 abgebildet als int16.

 

uint16 bildet in den Java Bindings auf int ab und int16 auf short.

 

Das zu ändern hieße entweder, eines der Poti in allen Bindings zu ändern, oder die kompletten Java Bindings zu ändern, das alle Integer als int abgebildet werden. Das wäre also eine großere Änderung.

 

Solche Typ-Unterschiede für Dinge die vermeintlich gleich sein sollten gibt es sicher noch mehrere. Man würde dann also nicht nur diesen ändern sondern dann alle auf mal.

 

Viel Arbeit auf allen Seiten mit wenig Gewinn. Ich denke wir werden das auf absehbare Zeit nicht ändern.

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.