Raspberry Pi Pico W LESSON 4: Create a Binary Counter Using the Pico W

  Рет қаралды 16,868

Paul McWhorter

Paul McWhorter

Күн бұрын

Пікірлер: 181
@vDC2me
@vDC2me 10 ай бұрын
Paul I really appreciate you giving us kids that chance to see your mistakes. God Bless you Brother
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
And may God richly bless you as well.
@DanRey-j4l
@DanRey-j4l Жыл бұрын
Hello Paul, thank you!!. Here is another version of the code part using bin() function and arrays to simplify it: from machine import Pin from time import sleep counter=1 maxCounter=15 myBin=bin(counter+16) Pins=[12,13,14,15] led=[0,0,0,0] for i in range(0,4): led[i]=Pin(Pins[i],Pin.OUT) while True: myBin=bin(counter+16) print(myBin) for i in range(0,4): led[i].value(int(myBin[6-i])) sleep(1) if counter==maxCounter: counter=0 else: counter+=1
@samhutchison8633
@samhutchison8633 25 күн бұрын
Nice solution. I would have gone down the route of populating an array with comma separated list
@dannycollins5698
@dannycollins5698 Жыл бұрын
I didn't even think to connect the resistors directly to the ground bar. I had all mine connected to another wire. I got the homework assignment completed, but I am definitely not a legend. I will be thinking of a snazzy design and will be posting it later. Thank you sir!
@tjeanneret
@tjeanneret Жыл бұрын
Just ordered the kit, it's going to be simpler ! I appreciate your teaching, thank you.
@pdep
@pdep 4 ай бұрын
Once you get past the coffee addiction and junior-grades joviality, these are excellent lessons. Nothing better yet found. My sincere thanks for your work.
@paulmcwhorter
@paulmcwhorter 4 ай бұрын
Indeed I love coffee but would not call it an addiction . . . just one of those small pleasures in life. As far as joviality, yes I do love doing these projects and showing others. Thanks for the comment, and hope you continue to enjoy the lessons.
@garagegeekguy
@garagegeekguy 3 ай бұрын
Paul is great - pdep ehhhhhh not so much
@keithlohmeyer
@keithlohmeyer Жыл бұрын
Thanks Paul! Looking forward to seeing all the homework solutions.
@temetnosce2951
@temetnosce2951 Жыл бұрын
I used free place on breadboard so I connected all those four LEDs to the ground with one resistor since current is so little. At engineering point this is no good if you don't know how big your system goes. I just had this smaller breadboard and using all knowledge what Paul told us about measuring current I realized that 0,25W resistor could take it all. So I thought how this wonderful project could be even more custom made and optimized :) Thank you Paul for your insights and pushing us further (I'm watching all of your videos and participate where I have hardware). You are my favorite teacher and I will send you many blessings to continue with new wonderful projects!
@romantercero4436
@romantercero4436 Ай бұрын
What is the problem of using one resistor to ground all the leds? I did the same thing.
@tjeanneret
@tjeanneret Жыл бұрын
Just got my kit, it's more interesting than I thought. Well packed, cleverly chosen components, good price, it's a bargain ! Thanks Paul ;-D
@warrenscorner
@warrenscorner Жыл бұрын
I am legend! I actually had a project similar to this at work. My controller is an Allen Bradley PLC but I also used a Nanotec Stepper motor and drive. The drive is programmed in C++. I used 4 outputs from the PLC and wired them to the inputs of the drive. If all of the outputs are off the stepper is at 0 degrees. Output 1 on is position 1, output 2 on position 2 and so forth. The machine drills holes in catheters. There are four different parts with two sets of holes. So I needed 8 positions.
@anupampal2950
@anupampal2950 Жыл бұрын
Hi Paul, Thanks for your awesome video tutorials. I feel so good to see you excited after you get a desired output. For long tome, I am disconnected with Embedded field. Somehow, KZbin suggested me your video. I have enjoyed many video of yours. I haven't tried it. But, how about : 1. Take decimal number 0. 2. Convert it to binary, and feed it to the ckt. 3. Increment the decimal number. 4. put 1, 2 and 3 into an infinite loop. ?? That would be feasible even if you take 8-bits or higher.
@Mellie45
@Mellie45 Жыл бұрын
Man thanks you so much for these tutorials, you helped me even back in the Arduino tutorials, Thank you for everything.
@parshvapatel8484
@parshvapatel8484 Жыл бұрын
BTW I love your explanation on binary numbers .
@alexsanchez-kk3ci
@alexsanchez-kk3ci 8 ай бұрын
thank you so much for these videos. learning so much as a beginner.
@adegboyekehinde2509
@adegboyekehinde2509 4 ай бұрын
I was successful in the homework. I did from 1-10
@romantercero4436
@romantercero4436 Ай бұрын
Good times! Feeling pretty proud of this one: from machine import Pin from time import sleep myLED1 = Pin(0,Pin.OUT) myLED2 = Pin(1,Pin.OUT) myLED3 = Pin(2,Pin.OUT) myLED4 = Pin(3,Pin.OUT) def set_gpio_to_zero(pin_count): for y in range(pin_count): for x in range(pin_count): myLED = Pin(x,Pin.OUT) myLED.value(0) sleep(0.1) def dec_to_binary(dec): bin_code = bin(dec)[2:] padding = (4-len(bin_code)%4)%4 return '0'*padding + bin_code for y in range(16): myLED1.value(int(dec_to_binary(y)[0])) myLED2.value(int(dec_to_binary(y)[1])) myLED3.value(int(dec_to_binary(y)[2])) myLED4.value(int(dec_to_binary(y)[3])) print(f"{y}:{dec_to_binary(y)[0]} {dec_to_binary(y)[1]} {dec_to_binary(y)[2]} {dec_to_binary(y)[3]}") sleep(.3) set_gpio_to_zero(4)
@BertRichard-k6m
@BertRichard-k6m 4 ай бұрын
This is what I came up with after lesson 3. Thanks for the great videos! from machine import Pin from time import sleep LED1 = Pin(0, Pin.OUT) LED2 = Pin(1, Pin.OUT) LED4 = Pin(2, Pin.OUT) LED8 = Pin(3, Pin.OUT) while True: for x in range(16): LED1.value(x & 1) LED2.value((x >> 1) & 1) LED4.value((x >> 2) & 1) LED8.value((x >> 3) & 1) sleep(.5)
@MorrWorm8
@MorrWorm8 11 ай бұрын
ok, im completely though lesson 4. I have an odd question or maybe a dumb question. in the code I was working on the knight rider project for my homework, and I was looking at the "from" machine and the "from" time and the "import". my question. is there a way to view the list of all the "from" list? or import list? say there are 1,800 from commands that can be used. how do I view that list of available commands for "from"? i.e. I have 'machine' and 'time' so far.
@MorrWorm8
@MorrWorm8 11 ай бұрын
I tried using the ol google thing but everything I have found is basically a link to teach you how to code. so any resource or point in the right direction is what im looking for. thanks in advance.
@jojomaritessdelrosario2434
@jojomaritessdelrosario2434 3 ай бұрын
boom!!!nicenice place you got there
@iTeedo
@iTeedo 12 күн бұрын
3:30 technically the row of ground isnt fully connected unless you bridge the middle piece to the other rail.
@paulmcwhorter
@paulmcwhorter 12 күн бұрын
It depends on the board. The boards in the sunfounder kit, and most boards for that matter, the ground and power rail go across the entire row.
@antoniomuntaner8111
@antoniomuntaner8111 24 күн бұрын
Could I use a variable instead a constant in the value parameter?. In this case I could simplify the code working with array.
@Ravensheart2000
@Ravensheart2000 2 ай бұрын
I am confused but I think I get the answer. In all the other videos I watch they put the resistor on the postive side of the circuit. You put it on the negative. So in reading I have concluded that the resistor restricts the flow of all electricity because it acts as a restrictor plate not a filter, thus the flow is reduced on both sides of the circuit?
@chrisgosling5408
@chrisgosling5408 Жыл бұрын
Great to see you looking so well Paul, at this present time I think I should be watching some of your faith videos! Great to see the Pico series I shall studies these although there is a reluctance as I find it just confuses Arduino IDE language with the python based largely on syntax translations. The Pico is great because it is so cheap with 12 bit ADC resolution as standard which for analogue world applications is great and good enough for most real world stuff. 16 bit would be a luxury but noise becomes an issue. The other really great thing is that Arduino run a Nano with the 12 Bit ARM chip from the Pico onboard. It cost a bit more but you can run it via the Arduino IDE in the regular code thanks to a project by Earle Philhower. While the rest of the world seems in dissarray the world of microcontrollers has never been more exciting! Keep up the good work Paul it is appreciated by a great many!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Please do watch the faith based series. Those are the topics of utmost importance.
@chrisgosling5408
@chrisgosling5408 Жыл бұрын
@@paulmcwhorter many thanks! best regards Chris
@twoface1192
@twoface1192 4 ай бұрын
What happens if the resistor is bent and you use it??
@raintardgamesalot
@raintardgamesalot Жыл бұрын
love the weathercam
@LanLanLan5iekh_man18
@LanLanLan5iekh_man18 10 ай бұрын
Giddyup had me dying. 🤣💀💀💀
@LanLanLan5iekh_man18
@LanLanLan5iekh_man18 10 ай бұрын
💀💀💀💀💀💀💀💀💀💀
@rassulkuatov6160
@rassulkuatov6160 7 ай бұрын
I am Legend! * Double chest pump :) Thank you very much for your lessons
@paulmcwhorter
@paulmcwhorter 7 ай бұрын
Legend!
@zbigniewloboda3393
@zbigniewloboda3393 Жыл бұрын
Great Presentation.😊
@danielsaenz5570
@danielsaenz5570 Жыл бұрын
Hey Paul! For the homework, are we allowed to different colored LEDs? Like Blue, Green, Red? Thanks!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
As long as all the LED are the same color.
@danielsaenz5570
@danielsaenz5570 Жыл бұрын
@@paulmcwhorter Okay Paul. 👍
@charlotteswift
@charlotteswift Жыл бұрын
Here is my solution kzbin.info/www/bejne/b369eISjoMp_d6M Unfortunately the LEDs don't show up very well. And here is my video on Pico W Security in case you missed it. You might find it useful, or you might not. kzbin.info/www/bejne/jHLcoXqJlM93kNE
@ke7uia
@ke7uia Жыл бұрын
Here is my homework for lesson 4. I wanted to place leds in a ball hat then blink them all over the place. But that was too complicated. I wanted to have a pointing explosion. I settled on a right and left row of lights. I also wanted to have a simple set of instructions. kzbin.info/www/bejne/pqSre2h-gb2BrtE
@ke7uia
@ke7uia Жыл бұрын
I am legend
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@TheTechRancher
@TheTechRancher Жыл бұрын
Paul, question. How do we know what size of resistor to use with LEDs? I bought some LEDs and don't know anything about the data. Meaning what current or voltage they are happy using. So, since I don't have this information it makes it hard to do the Ohm's Law for the resistor value.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Technically, you would use ohm's law. You would find what current the LED is designed to work at, and make sure to not exceed its max current limit. Then you would find the LED voltage drop in operation. Then you would find the maximum current the GPIO pins can safely supply and make sure to not exceed that. You would then use ohm's law to select a resistor that would keep the current below the max limits of the LED and the GPIO pins. Or you could use 220 ohm or 330 which will work for most circumstances.
@TheTechRancher
@TheTechRancher Жыл бұрын
@@paulmcwhorter Thank you for the answer. I had a friend give me some LEDs and they look just the same as what came in the kit. I am assuming they will have the same maximum current and voltage drop as those. I used them in my homewrok assignment and I used 330 Ohm to be on the safe side.
@RajeevSahasrabudhe-xc5it
@RajeevSahasrabudhe-xc5it Жыл бұрын
I am Legend!!! New thing I came to know is that my Bread board has two separate sections on the sides! unlike your bread board.
@yongxinlim6156
@yongxinlim6156 Жыл бұрын
What is the circuit simulation software u used?
@quadrishittu1035
@quadrishittu1035 4 ай бұрын
Fritzing
@bjornakeSwe
@bjornakeSwe Жыл бұрын
Hello Paul, as before I did my assignment, but as before I am not yet a friend with YT. The hardware bit was no problem and I solved the coding as well but I am a bit curious how you solve it because my code takes 105 lines in total. Wish I could show you.
@tjeanneret
@tjeanneret Жыл бұрын
...but I would never write the code you show ! It is so easier to use a range counter, convert the values to bin(), than make each digit correspond to a LED ;-D
@trumpone4443
@trumpone4443 Жыл бұрын
Great video.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Glad you enjoyed it
@ufo.architect
@ufo.architect Жыл бұрын
Thank you for teaching, The arduino r4 wifi is next?
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Yes. The R4 are not really available yet, when they become available, that will be the next class.
@NerdFrequency
@NerdFrequency Жыл бұрын
I used a function and a list of numbers. numbers = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] def writeBinary(number): if number >= 8: eightsLED.value(1) number -= 8 else: eightsLED.value(0) if number >= 4: foursLED.value(1) number -= 4 else: foursLED.value(0) if number >= 2: twosLED.value(1) number -= 2 else: twosLED.value(0) if number >= 1: onesLED.value(1) number -= 1 else: onesLED.value(0) while True: for number in numbers: writeBinary(number) time.sleep(1)
@DanielBrambilla-h9v
@DanielBrambilla-h9v 10 ай бұрын
"BOOOM Giddyup!" 💀💀💀
@twoface1192
@twoface1192 4 ай бұрын
😂Giddy Up!
@quaternion-pi
@quaternion-pi Жыл бұрын
Assignment #4: kzbin.info/www/bejne/gGOvh3Sno6l8aKc&ab_channel=Quaternion Tried to sync music with leds using hardware timer. I'm holding my breath for a series on engineering math taught by our alpha teacher - it would be bodacious.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Excellent work! I really would one day like to do a all in one class that taught math, Algebra 1 Through calculus all based on technology/projects. You learn all the math, but through practical fun real world problems. Just have not quiet mustered the energy to do it.
@edSabio572
@edSabio572 Жыл бұрын
@@paulmcwhorter I wish I had had you as a teacher. This is how math should be taught. Knowing what is used for.
@BallyBoy95
@BallyBoy95 9 ай бұрын
Love your outro. We need more engineers, and less people watching cat videos. 🤣
@danny12345
@danny12345 Жыл бұрын
Thank you
@Wythaneye
@Wythaneye Жыл бұрын
Throat is clear, head is clear, time to record some videos again! Here's my Lesson 3 solution: kzbin.info/www/bejne/imG5mXWlpdt7maM
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@ssyedyaseens
@ssyedyaseens 7 ай бұрын
Code using decimal to binary converter function incase someone needs it. from machine import Pin from time import sleep four = Pin(12, Pin.OUT) three = Pin(13, Pin.OUT) two = Pin(14, Pin.OUT) one = Pin(15, Pin.OUT) lights = [four, three, two, one] def toBinary(num): if num==1: return "1" elif num==0: return "0" return toBinary(num//2) + str(num%2) def assignToLights(num): binValue = toBinary(num) while len(binValue) < 4: binValue = "0" + binValue for i in range(0, len(binValue)): lights[i].value(int(binValue[i])) count = 0 while True: if count > 15: count = 0 assignToLights(count) sleep(1) count+=1
@TimNudd0525
@TimNudd0525 Жыл бұрын
I am legend! Beginner Based Homework for lesson 4: kzbin.info/www/bejne/sJmtdXZtrZyphK8 Plan to do a more advanced homework video later in the week once I finish fine tuning my creation :)
@ALRXM
@ALRXM Жыл бұрын
Homework for lesson 4: kzbin.info/www/bejne/eoCsZ4uCj76KmdE I had great fun trying to figure out a short way to create an interesting pattern.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Nice work!
@jameslewellen150
@jameslewellen150 Жыл бұрын
Here is the link for my homework. kzbin.info/www/bejne/kIXLkmh9i6yVo9k
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@shaggy7958
@shaggy7958 28 күн бұрын
For lesson 4, I added an extra LED and modified my counter from the previous lesson to implement a "bidirectional chaser". Here is the link:kzbin.info/www/bejne/Y6ucY6iFmrOdicU
@stevetalley9775
@stevetalley9775 Жыл бұрын
Link to homework code video. Too large for description section on KZbin. kzbin.info/www/bejne/np_Ig3Sthtpjm9U
@parshvapatel8484
@parshvapatel8484 Жыл бұрын
Hi Paul can you do a shop talk on how to avoid silly mistakes in maths if possible because. I know how to solve every single question on maths exam but perform horrible due to silly mistakes.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
The main issue is you need to practice more. You know the math but make silly mistakes because you are not practicing. Practice, practice, practice so you are working the problems almost without thinking. You have to practice to learn to work quickly and accurately
@parshvapatel8484
@parshvapatel8484 Жыл бұрын
@@paulmcwhorter thank you very much I will Practice Practice and Practice because I trust my Guru
@zacremboldt9160
@zacremboldt9160 23 күн бұрын
Completed homework: kzbin.info/www/bejne/eXaveWBti95-iaM Thanks Paul!
@paulmcwhorter
@paulmcwhorter 22 күн бұрын
LEGEND!
@mahdikhanzadi4233
@mahdikhanzadi4233 Жыл бұрын
better code (just give it your pin numbers): from machine import Pin from time import sleep pins = [18, 19, 20, 21] counter = 0 def control_pins(counter): binaryValue = bin(counter)[2:] binaryValue = '0' * (len(pins) - len(binaryValue)) + binaryValue for i in range(len(pins)): Pin(pins[i], Pin.OUT).value(int(binaryValue[i])) while True: control_pins(counter) sleep(0.5) counter = (counter + 1) % (2**len(pins))
@DrDave327
@DrDave327 Жыл бұрын
Double chest bump, Paul! Here is my solution to your homework assignment.: kzbin.info/www/bejne/eX-yhGSqh7-Fm6c The camera doesn't do the colors justice, unfortunately:( Thank you for all of your efforts for us!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@opokujoel7784
@opokujoel7784 10 ай бұрын
Boom!!! I am legend😄
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
LEGEND!
@larryb6759
@larryb6759 Жыл бұрын
Got it
@gonepostal63
@gonepostal63 Жыл бұрын
I am legend (mostly, it took an awfully long time to get it right)
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@Wythaneye
@Wythaneye Жыл бұрын
I am legend! Lesson 4 homework: kzbin.info/www/bejne/fGfcYX-id7Wtgck
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Excellent
@bigbogeyface
@bigbogeyface Жыл бұрын
Here's my homework: kzbin.info/www/bejne/iXTCdIVnn9-kfsU 🙂
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Spectacular!
@bigbogeyface
@bigbogeyface Жыл бұрын
@@paulmcwhorter Thank you 😊 🙏
@danielsaenz5570
@danielsaenz5570 Жыл бұрын
Here's my homework solution: kzbin.info/www/bejne/naq0Zqmbd6lsgMk A little late! :)
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@stevetalley9775
@stevetalley9775 Жыл бұрын
Link to homework: kzbin.info/www/bejne/fqS2damMe5V2pdU
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@WilliamBurlingame
@WilliamBurlingame Жыл бұрын
My Lesson 3 homework: kzbin.info/www/bejne/iKCXfqabh7erpq8
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@MooneyManMr
@MooneyManMr 10 күн бұрын
I am legend! (but I think there must be a more elegant way to achieve this!)
@paulmcwhorter
@paulmcwhorter 9 күн бұрын
LEGEND!
@peterbush3972
@peterbush3972 Жыл бұрын
I am legend!!
@kevinshaver5613
@kevinshaver5613 Жыл бұрын
I am legend!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@arlo4051
@arlo4051 Жыл бұрын
This doesn't really fall into this category except for the blinkey Led's (all blue because it's what I had) Might be better on the Raspberry Pi lesson because using Pi 4 with PCA9685 servo driver and Bullseye operating system. kzbin.info/www/bejne/l3vGXo2Oq56bqas
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Amazing!
@rassulkuatov6160
@rassulkuatov6160 7 ай бұрын
The homework: kzbin.info/www/bejne/hmKknmVtmbuaqassi=0n3_8jO-4_FgnYy2 Thank you very much! The solution is pretty simple,but I enjoyed it and very thankful to you!
@paulmcwhorter
@paulmcwhorter 7 ай бұрын
LEGEND!
@lorisrobots
@lorisrobots Жыл бұрын
Thanks Paul! I had this project in the works after we did the binary counter but I think it meets the intent of the HW. It seems a natural next project - thanks to @bigbogeyface for giving me this project idea. kzbin.info/www/bejne/d6vZY4aPpNqCpcU
@charlotteswift
@charlotteswift Жыл бұрын
Hi Paul & Guys. I won't be joining you for live chat on this lesson because it's Valentine's Day and I have plans💘Hurrah!!!!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Sounds great!
@edSabio572
@edSabio572 Жыл бұрын
Paul, I am not good at making patterns: here are my results Step#: 0 Ox% 1 1 0 1 1 Step#: 1 Ox% 0 1 1 0 0 Step#: 2 Ox% 0 0 0 0 0 Step#: 3 Ox% 1 1 1 0 0 Step#: 4 Ox% 1 0 1 1 1 Step#: 5 Ox% 0 1 1 1 0 Step#: 6 Ox% 0 0 0 1 1 Step#: 7 Ox% 0 0 1 0 0 Step#: 8 Ox% 1 0 0 0 0 Step#: 9 Ox% 1 1 0 0 0 Step#: 10 Ox% 0 1 0 0 1 Step#: 11 Ox% 0 1 1 0 0 Step#: 12 Ox% 1 0 1 0 0 Step#: 13 Ox% 1 1 0 1 0 Step#: 14 Ox% 0 1 1 1 0 Step#: 15 Ox% 0 1 0 1 1 Step#: 16 Ox% 1 0 0 0 1 Step#: 17 Ox% 1 0 1 1 1 Step#: 18 Ox% 1 0 1 0 1 Step#: 19 Ox% 0 1 1 1 1 Step#: 20 Ox% 0 0 1 1 1 Step#: 21 Ox% 0 0 1 1 1 Step#: 22 Ox% 0 1 0 0 0 Step#: 23 Ox% 1 1 1 1 1 Step#: 24 Ox% 1 1 0 1 0 Step#: 25 Ox% 0 0 0 0 1 Step#: 26 Ox% 0 1 0 0 1 Step#: 27 Ox% 0 1 0 0 1 Step#: 28 Ox% 0 1 0 0 1 Step#: 29 Ox% 1 1 0 0 1 Step#: 30 Ox% 1 1 1 1 1 Step#: 31 Ox% 1 0 1 1 0
@edSabio572
@edSabio572 Жыл бұрын
Thanks Paul! I am using arrays to program the patterns like the old school of c / c++, and Visual Basic. We used to have header or ini files... pattern1=[03,06,12,24,12,06,06,06, 12,24,12,06,03,06,12,24, 12,06,03,06,12,24,12,06, 03,06,12,24,12,06,03,06] >>> %Run -c $EDITOR_CONTENT Ox% 0 0 0 1 1 Ox% 0 0 1 1 0 Ox% 0 1 1 0 0 Ox% 1 1 0 0 0 . Ox% 0 0 0 1 1 Ox% 0 0 1 1 0
@LetsCalculateSomething
@LetsCalculateSomething Жыл бұрын
Here is my solution: kzbin.info/www/bejne/anOcc4Z-iJeib80 Thanks Paul. Learned to use Sequences and random numbers in Python!
@tripleyt6122
@tripleyt6122 Жыл бұрын
Can we connect the Rasberri Pi pico to camera , we can do that and can we use opencv moduel to perform the comuter vision tasks if we can do that make a viedo on it becuase it's cheap rasberri pi is cheap and if we can use it's capabilities to Max we can be like ICE COLD COFFE Awesom!!!!!
@xprmntlav8r
@xprmntlav8r Жыл бұрын
Here's my attempt at homework #4. kzbin.info/www/bejne/aXrIqHeodqpqedE Here's the code: from machine import Pin from time import sleep pinNum=[Pin(14,Pin.OUT),Pin(15,Pin.OUT),Pin(16,Pin.OUT),Pin(17,Pin.OUT),Pin(18,Pin.OUT)] #create an array of pins. delay= .05 def chaseCCW(delay): for n in range(5): pinNum[n].value(1) sleep(delay) pinNum[n].value(0) sleep(delay) def chaseCW(delay): for n in range(4,-1,-1): pinNum[n].value(1) sleep(delay) pinNum[n].value(0) sleep(delay) while True: for x in range(4): chaseCCW(delay) for x in range(4): chaseCW(delay) for x in range(4): chaseCCW(delay) chaseCW(delay) sleep(1)
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@-GrimEngineer-1337
@-GrimEngineer-1337 Ай бұрын
My Solution: from machine import Pin from time import sleep led1=Pin(12,Pin.OUT) led2=Pin(13,Pin.OUT) led3=Pin(14,Pin.OUT) led4=Pin(15,Pin.OUT) i=0 while True: if i & 1==1: led1.value(1) else: led1.value(0) if i & 2==2: led2.value(1) else: led2.value(0) if i & 4==4: led3.value(1) else: led3.value(0) if i & 8==8: led4.value(1) else: led4.value(0) sleep(.5) i+=1 if i==16: i=0
@kev67uk
@kev67uk Жыл бұрын
Another great lesson, thanks Paul, and here's my homework for this week: kzbin.info/www/bejne/mXjKda2MqdWjl7M It took slightly longer than usual as I ended up watching a few episodes of Knight Rider - for research of course! (and to bring back memories of my childhood 😁).
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@snowman58able
@snowman58able Жыл бұрын
I am legend, however instead of repeating all 4 leds for each count I only put in the led that change.
@davidh1187
@davidh1187 9 ай бұрын
MicroPython version of the Knight Rider Chaser in a format that KZbins doesn't default to shorts.... kzbin.info/www/bejne/bpW2koKhf8iahbM
@paulmcwhorter
@paulmcwhorter 9 ай бұрын
LEGEND!
@TheTechRancher
@TheTechRancher Жыл бұрын
Homework finished. Here is my link: kzbin.info/www/bejne/d5a4Z6F_eNZ_g7s Thank you @paulmcwhorter for all your hard work you have put into these courses.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@320mb
@320mb 2 ай бұрын
This is not Knight Rider stuff but I used Two LED patterns that I know all too well. I have 8 LED's going and took the Liberty of reproducing the first Patterns I learned to write in Assembler for my Breadboard computer that uses the 65c02 Processor. the first video shows 2 LED's scrolling right to left, the 2nd shows the 8 LED's flipping back and forth.... kzbin.infok3d-_twbyh0?si=gcr6tHTdB9kMEtVx kzbin.infoEEFovy-DVPE?si=v3yGLmfo96Fzt8T0
@PhysicsAssignmentHelp
@PhysicsAssignmentHelp Жыл бұрын
Thank you Paul! I wrote a simple code for this, it can be found here: kzbin.info/www/bejne/eoK4Y3msp99qaZo
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Well done!
@colepdx187
@colepdx187 Жыл бұрын
My homework for this tutorial: kzbin.info/www/bejne/maLFaZ-ch5aJh6c Thank you Mr. McWhorter! Great tutorials as usual.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@stephenlightkep1621
@stephenlightkep1621 Жыл бұрын
Hot tea Earl Grey
@davidh1187
@davidh1187 9 ай бұрын
Arduino IDE 2 and C version of Knight Rider Chaser kzbin.info_sFIyC59StM
@paulmcwhorter
@paulmcwhorter 9 ай бұрын
Excellent! Hey, please upload your homeworks as normal youtube videos, not shorts. Shorts dont allow comments, and you can not pause them. Thanks.
@davidh1187
@davidh1187 9 ай бұрын
Hi @@paulmcwhorter , Seems KZbin doesn't give me any other option than 'Shorts'. I guess I need to just make longer recordings to avoid this 'default'!
@akashdeadpool2824
@akashdeadpool2824 Жыл бұрын
# smallest algorithm for any numbers sir :) from time import sleep x=[] n=int(input("enter the lenth of binary numbers:")) for i in range(n): x.append(0) for f in range(2**n): y='' for j in range(-1,-len(x)-1,-1):y+=str(x[j]) print(y) sleep(.1) if x[0]==0: x[0]=1 continue else: x[0]=0 z=1 for i in range(1,len(x)): if x[i]==0 and z==1: x[i]=1 z=0 if x[i]==1 and z==1: x[i]=0
@jimworden9021
@jimworden9021 11 ай бұрын
Thanks, Paul. Here's my homework kzbin.info/www/bejne/bKm2koZriK16g8k . Spent a little time completely revamping my original code to reflect some of the things I've seen here and learned on my own.
@paulmcwhorter
@paulmcwhorter 11 ай бұрын
LEGEND!
@karliskide2460
@karliskide2460 Жыл бұрын
Thank you for the lesson! Here is my homework assignment for this one: kzbin.info/www/bejne/lZ67cqeIlJajrtk
@chases9870
@chases9870 Жыл бұрын
i am legend only 62 lines of code
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@chases9870
@chases9870 Жыл бұрын
we are running out of red led's are we going to use a specil led soon?
@DrDave327
@DrDave327 Жыл бұрын
Hey, Paul! I could not resist tweaking the arrays that I used in the LED assignment recently... kzbin.info/www/bejne/l5ukpJqmodWCerc
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Incredible. OK, if I had that build, I would make like all the LED red, and then one blue, and have the blue one running around. So many possibilities.
@DrDave327
@DrDave327 Жыл бұрын
@@paulmcwhorter Ok. I will see if I can do that.
@JUMPINGDONUT_
@JUMPINGDONUT_ 8 ай бұрын
Walmart lawn chair 😂
@alanbod47
@alanbod47 10 ай бұрын
Hello Paul, Using your tutorial I created a five LED binary counter that goes through the following sequence 1. All LEDS off 2. All LEDS on 3 LEDS light up in sequence 1 to 5 4. All LEDS flash quickly 5 LEDS light up in binary sequence to count 0 to 31 6 All LEDS flash quickly 7 a 3 second pause then back to 1 I found it helpful to put a comment before each block to help me keep track of problems. The video can be seen here and you can see I wired it in a different way from yours, but it seems to work. kzbin.info/www/bejne/ZmbagIuvnsh_kJI The code i used looked like this from machine import Pin from time import sleep led1=Pin(18,Pin.OUT) led2=Pin(17,Pin.OUT) led3=Pin(16,Pin.OUT) led4=Pin(15,Pin.OUT) led5=Pin(14,Pin.OUT) while True: #pin test led1.value(1) led2.value(1) led3.value(1) led4.value(1) led5.value(1) sleep(1) #all pins 0ff led1.value(0) led2.value(0) led3.value(0) led4.value(0) led5.value(0) sleep(1) #pin 1 on led1.value(1) led2.value(0) led3.value(0) led4.value(0) led5.value(0) sleep(1)
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
LEGEND!
@ErlankBru
@ErlankBru 3 ай бұрын
I am legend! from machine import Pin from time import sleep redLED1=Pin(12,Pin.OUT) redLED2=Pin(13,Pin.OUT) redLED3=Pin(14,Pin.OUT) redLED4=Pin(15,Pin.OUT) while True: redLED.value(0) redLED.value(0) redLED.value(0) redLED.value(0) sleep(1) redLED.value(0) redLED.value(0) redLED.value(0) redLED.value(1) sleep(1) redLED.value(0) redLED.value(0) redLED.value(1) redLED.value(0) sleep(1) redLED.value(0) redLED.value(0) redLED.value(1) redLED.value(1) sleep(1) redLED.value(0) redLED.value(1) redLED.value(0) redLED.value(0) sleep(1) ...and so on until 15, even though this is only up to 4. I will learn the shorter version with time, but this code did it for now.🙂
@codecage9333
@codecage9333 Жыл бұрын
Complete cheap WalMart lawn chair!
@ve2um
@ve2um Күн бұрын
For a chaser using 12 LED's : from machine import Pin from time import sleep mon_DEL0 = Pin(2,Pin.OUT) mon_DEL1 = Pin(3,Pin.OUT) mon_DEL2 = Pin(4,Pin.OUT) mon_DEL3 = Pin(5,Pin.OUT) mon_DEL4 = Pin(6,Pin.OUT) mon_DEL5 = Pin(7,Pin.OUT) mon_DEL6 = Pin(8,Pin.OUT) mon_DEL7 = Pin(9,Pin.OUT) mon_DEL8 = Pin(10,Pin.OUT) mon_DEL9 = Pin(11,Pin.OUT) mon_DEL10 = Pin(12,Pin.OUT) mon_DEL11 = Pin(13,Pin.OUT) d = 0.05 while True: mon_DEL0.value(1) sleep(d) mon_DEL1.value(1) sleep(d) mon_DEL2.value(1) sleep(d) mon_DEL3.value(1) sleep(d) mon_DEL4.value(1) sleep(d) mon_DEL5.value(1) sleep(d) mon_DEL6.value(1) sleep(d) mon_DEL7.value(1) sleep(d) mon_DEL8.value(1) sleep(d) mon_DEL9.value(1) sleep(d) mon_DEL10.value(1) sleep(d) mon_DEL11.value(1) sleep(d) mon_DEL0.value(0) sleep(d) mon_DEL1.value(0) sleep(d) mon_DEL2.value(0) sleep(d) mon_DEL3.value(0) sleep(d) mon_DEL4.value(0) sleep(d) mon_DEL5.value(0) sleep(d) mon_DEL6.value(0) sleep(d) mon_DEL7.value(0) sleep(d) mon_DEL8.value(0) sleep(d) mon_DEL9.value(0) sleep(d) mon_DEL10.value(0) sleep(d) mon_DEL11.value(0) sleep(d)
@ve2um
@ve2um Күн бұрын
Really start to have fun here... ..."Knight Rider" To make "Kitt" chase faster or slower. change the value of "d". from machine import Pin from time import sleep mon_DEL0 = Pin(2,Pin.OUT) mon_DEL1 = Pin(3,Pin.OUT) mon_DEL2 = Pin(4,Pin.OUT) mon_DEL3 = Pin(5,Pin.OUT) mon_DEL4 = Pin(6,Pin.OUT) mon_DEL5 = Pin(7,Pin.OUT) mon_DEL6 = Pin(8,Pin.OUT) mon_DEL7 = Pin(9,Pin.OUT) mon_DEL8 = Pin(10,Pin.OUT) mon_DEL9 = Pin(11,Pin.OUT) mon_DEL10 = Pin(12,Pin.OUT) mon_DEL11 = Pin(13,Pin.OUT) d = 0.1 while True: mon_DEL0.value(0) mon_DEL3.value(1) sleep(d) mon_DEL1.value(0) mon_DEL4.value(1) sleep(d) mon_DEL2.value(0) mon_DEL5.value(1) sleep(d) mon_DEL3.value(0) mon_DEL6.value(1) sleep(d) mon_DEL4.value(0) mon_DEL7.value(1) sleep(d) mon_DEL5.value(0) mon_DEL8.value(1) sleep(d) mon_DEL6.value(0) mon_DEL9.value(1) sleep(d) mon_DEL7.value(0) mon_DEL10.value(1) sleep(d) mon_DEL8.value(0) mon_DEL11.value(1) sleep(d) mon_DEL11.value(0) mon_DEL8.value(1) sleep(d) mon_DEL10.value(0) mon_DEL7.value(1) sleep(d) mon_DEL9.value(0) mon_DEL6.value(1) sleep(d) mon_DEL8.value(0) mon_DEL5.value(1) sleep(d) mon_DEL7.value(0) mon_DEL4.value(1) sleep(d) mon_DEL6.value(0) mon_DEL3.value(1) sleep(d) mon_DEL5.value(0) mon_DEL2.value(1) sleep(d) mon_DEL4.value(0) mon_DEL1.value(1) sleep(d) mon_DEL3.value(0) mon_DEL0.value(1) sleep(d)
@djicedragon855
@djicedragon855 8 ай бұрын
Homework 4 kzbin.info/www/bejne/aZyqd62rm6ebfpIsi=-ahvZ_Eob8aLr8mM
@paulmcwhorter
@paulmcwhorter 8 ай бұрын
LEGEND!
Raspberry Pi Pico W LESSON 2: Understanding and Using  Breadboards
34:10
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Pico W Episode 1: Setting Up the Raspberry Pi Pico W
12:48
Lori Pfahler
Рет қаралды 16 М.
What is an Inertial Measurement Unit (IMU)?
4:25
Phidgets Inc.
Рет қаралды 7 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН