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

Hey Tinker's,

 

ist es möglich die RGB-Led's mit der API oder einer anderen Methode zu dimmen?

 

Grüße Dan

Geschrieben

Es gibt 255 Helligkeitsstufen je Farbe (RGB). Ich denke, dass kann man "dimmen" nennen.

 

# Set first 10 LEDs to green

r = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

g = [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0]

b = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

led_strip.set_rgb_values(0, 10, r, g, b)

Geschrieben
  • Autor

genau so habe ich es bisher auch gelöst, allerdings ist das ja keine optimale Lösung wenn man eine Farbe die aus r 255, g 20, b 100 besteht dimmt verändert sich der Farbton komplett wenn g = 0 ist und die anderen Farben weiter gedimmt werden.

 

Grüße dan

Geschrieben

du müsstet schon "proportional" jeden Farbanteil gleich dimmen.

 

255,20,100 in 20 Schritten

-->242,19,95

-->229,18,90

-->...

 

dann klappt es auch mit den Farbwerten. "Runden" ist kein Problem, das menschl. Auge bekommt das nicht mit  :)

Geschrieben

Ich würde Wikipedia-Artikel (oder andere Quellen) zu den Begriffen HSV und HSL empfehlen. (Hue, Saturation, Lightness/Brightness)

 

Das sind Farbmodelle die genau das von dir beschriebene Problem addressieren. Da kannst du einmal die Umrechnung implementieren (wenn deine Standardbibliothek nicht schon soetwas bietet) und dann einfach die Umrechnung nutzen.

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.