issue182:micro-ci_micro-la
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue182:micro-ci_micro-la [2022/06/27 09:27] – créée auntiee | issue182:micro-ci_micro-la [2022/06/30 16:10] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | In my Python article for this month, I said “Being from Texas, most of us here have a tendency to “change horses in midstream” as the saying goes, and this month, I’m afraid I’m going to have to do just that.”. That applies even to the ‘Micro This Micro That’ article for this month. I try very hard to be consistent, but when issues come up with readers and/or users, I try to share information that might help other readers, especially when the topic is relevant to the subject of the articles. Last month, I said that I would expand on the compass project. My friend in Norway, Halvard, contacted me yesterday with an issue that dealt with his NeoPixel ring that I tried to help him with, and I thought I’d share that with you. | + | **In my Python article for this month, I said “Being from Texas, most of us here have a tendency to “change horses in midstream” as the saying goes, and this month, I’m afraid I’m going to have to do just that.”. That applies even to the ‘Micro This Micro That’ article for this month. I try very hard to be consistent, but when issues come up with readers and/or users, I try to share information that might help other readers, especially when the topic is relevant to the subject of the articles. Last month, I said that I would expand on the compass project. My friend in Norway, Halvard, contacted me yesterday with an issue that dealt with his NeoPixel ring that I tried to help him with, and I thought I’d share that with you. |
- | He had found a new driver library for the Raspberry Pi Pico that was supposed to handle the NeoPixel devices a bit better than the “standard” statemachine version that we have used in the past. However, he was having a problem on his system, where, when he ran the example program, he set the number of LEDs to 24, but only 18 ever lit. That seemed very strange to me, so I started looking into his issue. | + | He had found a new driver library for the Raspberry Pi Pico that was supposed to handle the NeoPixel devices a bit better than the “standard” statemachine version that we have used in the past. However, he was having a problem on his system, where, when he ran the example program, he set the number of LEDs to 24, but only 18 ever lit. That seemed very strange to me, so I started looking into his issue.** |
- | He pointed me to the repository for the driver which is https:// | + | Dans l' |
+ | |||
+ | Il avait trouvé une nouvelle bibliothèque de pilotes pour le Raspberry Pi Pico qui était censée gérer les périphériques NeoPixel un peu mieux que la version statemachine « standard » que nous avons utilisée dans le passé. Cependant, il avait un problème sur son système, où, quand il a exécuté le programme d' | ||
+ | |||
+ | |||
+ | **He pointed me to the repository for the driver which is https:// | ||
The first thing I did was to change the Driver ‘In pin’ in the instantiation function call. | The first thing I did was to change the Driver ‘In pin’ in the instantiation function call. | ||
Ligne 12: | Ligne 17: | ||
In the example file the author uses | In the example file the author uses | ||
+ | |||
+ | led = neopixel_rp2040.neopixel(LEDS=2, | ||
+ | |||
+ | Il m'a indiqué le dépôt du pilote qui est https:// | ||
+ | |||
+ | La première chose que j'ai faite a été de changer le pilote « In pin » dans l' | ||
+ | |||
+ | led = neopixel_rp2040.neopixel(LEDS=2, | ||
+ | |||
+ | Pour rappel, l' | ||
+ | |||
+ | Dans le fichier d' | ||
led = neopixel_rp2040.neopixel(LEDS=2, | led = neopixel_rp2040.neopixel(LEDS=2, | ||
- | I purposely kept the number of LEDs set to 2, just to verify that the program worked. Halvard’s issue was that if he set the number of LEDs to 24, only the first 18 worked. To get the entire 24 to light, he had to set the LEDs to 32. | + | |
+ | **I purposely kept the number of LEDs set to 2, just to verify that the program worked. Halvard’s issue was that if he set the number of LEDs to 24, only the first 18 worked. To get the entire 24 to light, he had to set the LEDs to 32. | ||
Anyway, back to my story. When I tried to run the example, nothing happened. I was very confused. It turned out that my battery pack (which uses rechargeable batteries) had run low on power. After a brief 2 hours of replacing electrons into the batteries, I tried again. | Anyway, back to my story. When I tried to run the example, nothing happened. I was very confused. It turned out that my battery pack (which uses rechargeable batteries) had run low on power. After a brief 2 hours of replacing electrons into the batteries, I tried again. | ||
Ligne 21: | Ligne 39: | ||
The example program worked with just the two LEDs without an issue (except for the brightness) and I then moved on to a test using just 12 LEDs. Again it worked. I then took a deep breath and tried all 24. Again, it worked. | The example program worked with just the two LEDs without an issue (except for the brightness) and I then moved on to a test using just 12 LEDs. Again it worked. I then took a deep breath and tried all 24. Again, it worked. | ||
- | When I say that the brightness was an issue, I’m just saying that the darn things are TOO BRIGHT for my old eyes. It thought I was looking directly into a bright halogen bulb! So, I let Halvard know my progress and suggested that he check his battery pack. | + | When I say that the brightness was an issue, I’m just saying that the darn things are TOO BRIGHT for my old eyes. It thought I was looking directly into a bright halogen bulb! So, I let Halvard know my progress and suggested that he check his battery pack.** |
- | It turns out that Halvard had purchased a newer version of the PixelRing that is RGBW, not just RGB. While you would think (on one side of your brain), that the RGB drivers would work with RGBW NeoPixel sets. They do, but not quite properly. | + | J'ai volontairement maintenu le nombre de DEL à 2, juste pour vérifier que le programme fonctionnait. Le problème de Halvard était que s'il réglait le nombre de DEL à 24, seules les 18 premières fonctionnaient. Pour que les 24 s' |
+ | |||
+ | Bref, revenons à mon histoire. Lorsque j'ai essayé d' | ||
+ | |||
+ | Le programme d' | ||
+ | |||
+ | Quand je dis que la luminosité était un problème, je dis simplement que ces fichues choses sont TROP LUMINEUSES pour mes vieux yeux. J' | ||
+ | |||
+ | |||
+ | **It turns out that Halvard had purchased a newer version of the PixelRing that is RGBW, not just RGB. While you would think (on one side of your brain), that the RGB drivers would work with RGBW NeoPixel sets. They do, but not quite properly. | ||
When trying to figure out why things were not quite right, I stumbled across this web site https:// | When trying to figure out why things were not quite right, I stumbled across this web site https:// | ||
Ligne 29: | Ligne 56: | ||
“The RGBW ‘Neopixels’ are a different controller, SK6812, but it looks like the actual protocol is very similar (except for having 32 bits per LED instead of 24). It sounds like it’d be worth starting from the WS2812 library and making some modifications.” | “The RGBW ‘Neopixels’ are a different controller, SK6812, but it looks like the actual protocol is very similar (except for having 32 bits per LED instead of 24). It sounds like it’d be worth starting from the WS2812 library and making some modifications.” | ||
- | So that explains why things went wonky when Halvard tried to use the driver for WS2812 NeoPixels when he actually had SK6812 NeoPixels. Thank you Peter for the explanation. | + | So that explains why things went wonky when Halvard tried to use the driver for WS2812 NeoPixels when he actually had SK6812 NeoPixels. Thank you Peter for the explanation.** |
- | So off I went again on a search for a driver that would, at least, support the SK6812 and hopefully for the WS2812 as well. I found it at https:// | + | Il s'est avéré qu' |
+ | |||
+ | En essayant de comprendre pourquoi les choses n' | ||
+ | |||
+ | « Les ' | ||
+ | |||
+ | Cela explique donc pourquoi les choses se sont gâtées lorsque Halvard a essayé d' | ||
+ | |||
+ | |||
+ | **So off I went again on a search for a driver that would, at least, support the SK6812 and hopefully for the WS2812 as well. I found it at https:// | ||
On his repository he states: | On his repository he states: | ||
Ligne 41: | Ligne 77: | ||
pixels = Neopixel(10, | pixels = Neopixel(10, | ||
- | Mind that you can use whichever order of RGB / RGBW you want (GRB, WRGB, GRB, RGWB ...). This only represents the order of data sent to led-strip, all functions still work with RGBW order. Exact order of leds should be on the package of your led-strip. (My BTF-lights sk6812 has GRBW).” | + | Mind that you can use whichever order of RGB / RGBW you want (GRB, WRGB, GRB, RGWB ...). This only represents the order of data sent to led-strip, all functions still work with RGBW order. Exact order of leds should be on the package of your led-strip. (My BTF-lights sk6812 has GRBW).”** |
- | So if you are using a RGBW strip or ring, you can simply use the initialization as shown above in the quote. | + | Je suis donc reparti à la recherche d'un pilote qui, au moins, prendrait en charge le SK6812 et, espérons-le, |
+ | |||
+ | Sur son dépôt, il déclare : | ||
+ | |||
+ | « Vous créez un objet avec comme paramètres le nombre de LEDs, l'ID de la machine d' | ||
+ | |||
+ | from neopixel import Neopixel | ||
+ | |||
+ | pixels = Neopixel(10, | ||
+ | |||
+ | Notez que vous pouvez utiliser n' | ||
+ | |||
+ | |||
+ | **So if you are using a RGBW strip or ring, you can simply use the initialization as shown above in the quote. | ||
pixels = Neopixel(10, | pixels = Neopixel(10, | ||
Ligne 57: | Ligne 106: | ||
As always, Pin refers to the IO pin, not the physical pin. | As always, Pin refers to the IO pin, not the physical pin. | ||
- | The distribution comes with four example programs that show off the abilities of the driver and I have to admit, they work well, both for me and for Halvard – who tested them as well and they ran fine for him when he modified the initialization call. | + | The distribution comes with four example programs that show off the abilities of the driver and I have to admit, they work well, both for me and for Halvard – who tested them as well and they ran fine for him when he modified the initialization call.** |
- | My favorite example is the firefly example program. It reminds me of summer evenings back when I was a child, chasing the fireflies in the back yard with a mason jar my mother let me use. Even today, when I see fireflies (which are actually in the beetle family and not flies at all), I am thrown back to those memories. | + | Donc si vous utilisez une bande ou un anneau RGBW, vous pouvez simplement utiliser l' |
+ | |||
+ | pixels = Neopixel(10, | ||
+ | |||
+ | Si, par contre, vous utilisez une bande ou un anneau RBG plus ancien, vous pouvez simplement remplacer la désignation du mode " | ||
+ | |||
+ | pixels = Neopixel(10, | ||
+ | |||
+ | Les paramètres sont simples. | ||
+ | |||
+ | pixels = Neopixel(NumberOfPixels, | ||
+ | |||
+ | Comme toujours, Pin fait référence à la broche IO, pas à la broche physique. | ||
+ | |||
+ | La distribution est livrée avec quatre programmes d' | ||
+ | |||
+ | |||
+ | **My favorite example is the firefly example program. It reminds me of summer evenings back when I was a child, chasing the fireflies in the back yard with a mason jar my mother let me use. Even today, when I see fireflies (which are actually in the beetle family and not flies at all), I am thrown back to those memories. | ||
So, with the pause for this month’s update, we'll press play on the compass program next month using the new driver for the NeoPixel display. | So, with the pause for this month’s update, we'll press play on the compass program next month using the new driver for the NeoPixel display. | ||
- | Until next time, as always; stay safe, healthy, positive and creative! | + | Until next time, as always; stay safe, healthy, positive and creative!** |
+ | |||
+ | Mon exemple préféré est le programme d' | ||
+ | |||
+ | Ainsi, après la pause de ce mois pour la mise à jour, nous allons appuyer sur le programme de la boussole le mois prochain en utilisant le nouveau pilote pour l' | ||
+ | |||
+ | Jusqu' | ||
issue182/micro-ci_micro-la.1656314841.txt.gz · Dernière modification : 2022/06/27 09:27 de auntiee