Asked
Viewed 17 times
0
Trying to be the half-term hero I know I can be. I have a Pimoroni Blinkt unit that I’m running a ‘for i in range’ command on creating an endless loop.
That’s cool, but how do I modify the code to make the light as much like kit’s front light from knightrider…
Current code –
while True: for i in range(8): clear() set_pixel(i, 255, 0, 0) show() time.sleep(0.01)
Thanks
New contributor
-
Hi Peter, Welcome and nice to meet you. Ah, let me see. I don’t quite understand your single statement. It would help if you can show us a longer list of your program, and sprinkle a little bit more comments here and there. Happy half-term holiday. Cheers. – tlfong01 7 hours ago
-
PS – Please let us know if you are using the same references list below, and if you are using any of their examples as a temple to write your “for i in range” program: References: (1) “Pimoroni Blinkt! Eight super-bright RGB LED indicators that are ideal for adding visual notifications to your Raspberry Pi without breaking the bank! £5.40”: shop.pimoroni.com/products/blinkt, (2) “Pimoroni/blinkt GitHub python program library”: github.com/pimoroni/blinkt, (3) “Pimoroni/blinkt GitHub python program library” github.com/pimoroni/blinkt/tree/master/examples. – tlfong01 7 hours ago
-
If you look in the example code in the github repo (github.com/pimoroni/blinkt/tree/master/examples) try running larson.py – Steve Robillard 5 hours ago
-
Hey guys, so this is what I was working off of, will give larson a go – learn.pimoroni.com/tutorial/sandyj/getting-started-with-blinkt – Peter James 1 hour ago
-
Hi Peter, Oh my goodness, just give Larson a go, and that’s it? How can such a lazy guy become a half-term hero? In my ninja opinion, to be a hero, you need to do harder homework at three times more than say, the following: (1) Try ALL the 20+ Blinkt examples. (2) Understand and MEMORIZE all the technical terms. Eg, you should be able to smoothly explain what is “HSV”, and how is it defferent from “RGB”, (3) , / to continue, … – tlfong01 3 mins ago Edit
-
(3) Understand EVERY statement of every example, (4) Write higher level functions than those in Blinkt. For example, define a superHero function called “superSetPixel”, so you can say “superPixel(‘SeventhLed, ‘NavyBlue’)” instead of stupidly, nonheroly, “set_pixel(i, 255, 0, 0)”. To do this you need to learn and practise how to use “dictionary”, “list”, and “tuple” data structure which heroes practise everyday (yes, like Panda GungFu!). (a) One comment on Pimoroni Blint: I skimmed the Blinkt tutorial and found PirateNinja more newbie friendly than Lada Ada, / ton continue, … – tlfong01 15 secs ago Edit
-
(b) One suggestion: Use Thonny to run your python code, because Thonny makes a hero sooner than terminal commands. Cheers! – tlfong01 10 secs ago Edit
Categories: Uncategorized
