Raspberry Pi LESSON 10: Making a Dimmable LED with Two Push Buttons

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ธ.ค. 2024

ความคิดเห็น • 87

  • @aman-sood
    @aman-sood 2 ปีที่แล้ว +3

    I am legend, I like how your solutions are elegant and address the minutest problems! Also like how you implement math into all of this. Thanks for everything you do.

  • @cbrombaugh
    @cbrombaugh 2 ปีที่แล้ว +3

    I AM LEGEND! BUT--- I did the original homework on my own and it worked as required. I then entered Paul's modified version with the 10 button press modification and found an error. It technically worked as described , but extra up button presses make BP continue to increase and require extra down button presses until the brightness starts to decrease. Of course, this is easily fixed. I just wanted Paul to see that someone is actually following his lessons in detail. 🙂 Thanks for all the time and effort you devote to these courses, Paul.

  • @RobVollmar
    @RobVollmar ปีที่แล้ว +2

    Paul,
    I hit a rough patch a couple of weeks back and chuffed like three assignments in a row. So, I went all the way back lesson six when we started on internal resistors and went through all the work again. I'm really proud to say that I was able to do them the second time through. Yes, I may have remembered some amount of what you covered the first time but believe me when I say that there was plenty that I didn't!
    I did this whole dimmer switch problem on Notepad before I committed a single line of code to the terminal and still had another couple of hours worth of head scratching and debugging. I felt like I had really accomplished something when I finally worked out all the bugs.

  • @terryneves1573
    @terryneves1573 22 วันที่ผ่านมา

    This series is amazing! I have been learning so much from it, especially from the homework assignments.

  • @krishnapranav9123
    @krishnapranav9123 ปีที่แล้ว +1

    Loved this lesson!!
    But instead of introducing a new variable BP we can just divide DC by 1.589 or multiply it with 1.589
    Same as we did with 2 and we got 7 button pushes

  • @smitt76
    @smitt76 ปีที่แล้ว +1

    I’m working through these lessons with my 10 year old son. He had just just crashed the program when you called out the guy who will “sit there and push the button until you crash the program, and you know who you are.” He looked at me and said, “I’m the guy!” and then almost fell out his chair laughing. Very funny moment

  • @magwitch
    @magwitch 9 หลายเดือนก่อน

    I am legend! Thanks for these tutorials Paul, it’s massively helping for my dissertation. I used an array to select the duty cycle which was no way near as tidy as DC*2, but I felt pretty smug when I realised my way bypassed doing logs!
    Cheers from the UK

  • @lorisrobots
    @lorisrobots 2 ปีที่แล้ว

    Thanks for adding in the log lesson and how to deal with the nonlinearity of brightness. I noticed that it was not linear as I was coding but I left my solution with linear change. I think I was distracted by cute cat videos 🙂!

  • @arguedas02
    @arguedas02 2 ปีที่แล้ว +1

    Great work you do Mr. Paul. we need more people like you willing to share the knowledge God Bless you and you family....

  • @opalprestonshirley1700
    @opalprestonshirley1700 2 ปีที่แล้ว

    Anything that speeds the accuracy and ease of design for our work is great. Love the math. God Bless.

  • @charlotteswift
    @charlotteswift 2 ปีที่แล้ว +2

    I didn't use logs in my programs. I just took the nth root of 100 to get the increments in brightness.
    Pi 4 version (code in description) - th-cam.com/video/EwQUzXukUAo/w-d-xo.html
    Pico version (code in description) - th-cam.com/video/edWcbNIrXn4/w-d-xo.html

  • @ion4497
    @ion4497 2 หลายเดือนก่อน

    THE AUDITION AND THE VISION IN HUMAN HAVE A LOGARITMIC SCALE . When you notice the stimulus duplicated is because in phisical system the signal was 10 times more energy . That allow us to catch wide range of frecuency..... thanks paul

  • @MrCameronMoore
    @MrCameronMoore 2 ปีที่แล้ว

    Sadly my Raspberry Pi is still the boss. As an old guy (65) I have learnt over the years that maths is the language of engineering, so keep serving it up.

  • @TheUnofficialMaker
    @TheUnofficialMaker 2 ปีที่แล้ว +1

    Thanks for showing us the Log function. I would like to see you do a lesson on logs.

  • @theotrg_0
    @theotrg_0 2 ปีที่แล้ว +3

    😍😍 What an amazing content. I really admire you for you huge knowledge Mr Paul. Plus don't ever stop sharing it with us!

  • @keyboardlearning7552
    @keyboardlearning7552 2 ปีที่แล้ว

    I am Legend. Mine worked at the second attempt! This is a great explanation of logs. Well done, and many thanks for this series.

  • @itsmeintorrespain2714
    @itsmeintorrespain2714 2 ปีที่แล้ว

    Fantastic lesson. I'm going to redo my homework using the python math module (if I can!) and then measure the DCs with my newly acquired cheap USB oscilloscope. But don't hold your breath!

  • @rickbonari4493
    @rickbonari4493 2 ปีที่แล้ว +1

    Fantastic lesson and the math is so awesome !!!!! A lesson on logarithms would be great and very helpfull for future lessons.

  • @davidschnider1297
    @davidschnider1297 ปีที่แล้ว

    GREAT, fun lesson, Paul... yes.. one of the 1st times using logarithms OUTSIDE of an academic environment... POWERFUL tool, indeed... these HAVE been exciting lessons ... and I am ready and eager to move on to the next lesson.. Blessings...

  • @keithlohmeyer
    @keithlohmeyer 2 ปีที่แล้ว +1

    Cool! I enjoyed the refresher on logarithms.

  • @larryplatzek9017
    @larryplatzek9017 2 ปีที่แล้ว

    This is another Great Lesson! Hope you have a safe time in the bush!

  • @robinedminson6461
    @robinedminson6461 ปีที่แล้ว

    Hi Paul. I found that I need to restrict the range of BP [ if BP>10: BP=10 and if BP

  • @jonathanlanders9406
    @jonathanlanders9406 ปีที่แล้ว

    I am legend!
    Will be watching for an opportunity to use exponents for steps.

  • @Wythaneye
    @Wythaneye 2 ปีที่แล้ว

    I was legend! I say WAS, because though my code works I see some improvements it needs. I'll get my original solution and then my revised solution posted.

  • @TheRaviteja6
    @TheRaviteja6 ปีที่แล้ว

    very nice explanation sir

  • @freddyveza
    @freddyveza ปีที่แล้ว

    Well, This is the third time my comment is deleted... This time just say I'm legend, thanks Paul for making this lessons

  • @mddanishakhtar9025
    @mddanishakhtar9025 ปีที่แล้ว

    really sir, your are great JAADUGAR😊😊😇💕

  • @whoknows1893
    @whoknows1893 2 ปีที่แล้ว +1

    I would like to see livestreams where the audience can ask questions about math.

  • @pralaymajumdar1206
    @pralaymajumdar1206 2 ปีที่แล้ว

    You are really a magic man.. 🙏🙏🙏

  • @jawasparky6347
    @jawasparky6347 7 หลายเดือนก่อน

    Great Lessons!!! Just wondering why you are not using Thonny since it is included in the Raspberry Pi OS?

  • @daviddirac5942
    @daviddirac5942 2 ปีที่แล้ว

    I am legend. Thanks for the lesson on using log maths.

  • @Lehibob
    @Lehibob 2 ปีที่แล้ว +1

    Thanks for the math @Paul McWhorter! Feel free to do a log lesson or even a full ‘Math for Engineering’ tutorial series!

  • @kylehoell
    @kylehoell ปีที่แล้ว

    Hey, just wanted to mention why you can use 0 for the duty cycle, while not being able to use 99. This is because 0 is inclusive, and 100 would be exclusive. Because if you think about it, since 0 is allowed, and up to 99 (including 99), that is actually 100 values for you to choose from (0-99). If it did allow 100, it would be 101 values you can choose from (0-100) which makes no sense.

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว +1

      I understand what you are saying, but from a practical point, I would like the option of turning the signal completely off by having a duty cycle of 0 and have it on all the time with a duty cycle of 100. Now, with PWM, I can only have 99% of full signal. Practically, it is OK if that took 101 steps.

  • @carol-lo
    @carol-lo ปีที่แล้ว

    This is so much fun!

  • @邓慧琪
    @邓慧琪 5 หลายเดือนก่อน

    Hi Magicman Paul, could I use my components from arduino kits in Raspberry Pi project? Many thanks!!! Looking forwards to your reply😊

  • @aman-sood
    @aman-sood 2 ปีที่แล้ว

    How did I miss this??? Paul did you change the schedule? This premiered at 3 AM where I live

  • @soteros1983
    @soteros1983 2 ปีที่แล้ว

    Young me: I’ll never use this math stuff…
    Mr. McWhorter: Oh my sweet summer child (takes a sip of his coffe)

  • @ninjinblox1737
    @ninjinblox1737 2 ปีที่แล้ว

    cool it worked here

  • @wendygrant2735
    @wendygrant2735 2 ปีที่แล้ว

    I'm confused about the hour of this lesson. Normally it's at 17.00 hours my time, this time it was 17 hours before this, so at midnight for me. Did you change the hour Sir and what about the future lessons?

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว

      It was a mistake Wendy. A simple mistake! I probably confused AM and PM when I posted it. I actually slept through the premier so it got me off guard as well. My apologize

  • @mohammadm.taheri9303
    @mohammadm.taheri9303 2 ปีที่แล้ว

    Awesome !

  • @yeeha8815
    @yeeha8815 2 ปีที่แล้ว +1

    I folded up like a cheap walmart lawn chair BROTHER

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว

      Yet you will get up, dust yourself off, and try again. Next time, LEGEND!

    • @yeeha8815
      @yeeha8815 2 ปีที่แล้ว

      @@paulmcwhorter Thanks man!
      I say that because I didn't do the homework, but I have been using your lessons to try to control a synthesizer circuit i've been playing with.
      Your videos have been very helpful in my quests to experiment!

  • @marinkokljajic1725
    @marinkokljajic1725 2 ปีที่แล้ว

    Please try ‚,except InvisibleKeyInterrupt:‘‘ :). Thanks a lot for the tutorials!!

  • @suelingsusu1339
    @suelingsusu1339 2 ปีที่แล้ว

    Bravo!!!

  • @wardeneternal1140
    @wardeneternal1140 5 หลายเดือนก่อน

    I am legend! finally lol

  • @nikitapolyakov2259
    @nikitapolyakov2259 4 หลายเดือนก่อน

    why did we need to do the whole thing with the logs? If using a calculator is ok why not just do
    100 = A^10
    root10 of 100 = A or 100^(1/10) = A
    1.5849 = A

    • @paulmcwhorter
      @paulmcwhorter  4 หลายเดือนก่อน +1

      Exponentials and logs are two sides of the same coin. It is fine to use exponentials, but there is no reason to try to avoid understanding and using logs. Most real world engineering problems require understanding of logs, so we should become comfortable with them

  • @partharora6023
    @partharora6023 2 ปีที่แล้ว

    sir what is AI , ML,DL, DATA SCIENCE ,NLP

  • @liamoliverdarroch6482
    @liamoliverdarroch6482 ปีที่แล้ว

    I am legend!

  • @arshdeepsingh5950
    @arshdeepsingh5950 4 หลายเดือนก่อน

    I AM LEGEND!!!!!!!

  • @Declek-Hub
    @Declek-Hub 2 ปีที่แล้ว

    Coffee without sugar will be very bitter.

  • @MultiTechEducation4U
    @MultiTechEducation4U 2 ปีที่แล้ว

    🙏🙏👍

  • @Wythaneye
    @Wythaneye 2 ปีที่แล้ว

    Life is busy, what can I say. I finally got my video posted for lesson #10. Similar to #9 but with an exponential scale instead of linear. th-cam.com/video/Bfvy2q8cRhc/w-d-xo.html

  • @TheUnofficialMaker
    @TheUnofficialMaker 2 ปีที่แล้ว

    I found out that it could also be done this way: Taking the 10th root is by far the easiest, But if you insist on involving logarithms, you can utilize the rule log(𝑎𝑏)=𝑏∗log(𝑎), but all that really gives is a complicated expression for 10th root of 100 (stackexchange)
    ln(𝑎)=[ln(100)]÷10≈0.4605. Therefore, 𝑎≈𝑒 power 0.4605≈1.585

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว +1

      The math is really the same. What you are doing is correct, and works the same, and in fact the rules you are using are part of the rules of logarithms. Just in this case, you can write the problem such the logs cancel themselves out. Taking roots is a very fine way of doing it. I do really love tis type of math

  • @peterkarlsson7801
    @peterkarlsson7801 2 ปีที่แล้ว

    I am legend

  • @kenstephens221
    @kenstephens221 2 ปีที่แล้ว +1

    Like the use of logarithms for determining steps. Thanks. Why not put the math in the program after you explained it, instead of the calculated value? Let the program do the work.

    • @TheUnofficialMaker
      @TheUnofficialMaker 2 ปีที่แล้ว

      Yes, you could have an input for the number of pushes you want (n) and then take the nth root of 100. :)

  • @mohammadm.taheri9303
    @mohammadm.taheri9303 2 ปีที่แล้ว

    Iam legend (LOL)

  • @syohomuga
    @syohomuga 4 หลายเดือนก่อน

    from time import sleep
    import RPi.GPIO as GPIO
    delay =.1
    inPin_1 = 29
    inPin_2 = 33
    outPin = 37
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(outPin, GPIO.OUT)
    GPIO.setup(inPin_1, GPIO.IN, pull_up_down=GPIO.PUD_UP)
    GPIO.setup(inPin_2, GPIO.IN, pull_up_down=GPIO.PUD_UP)
    myPWM = GPIO.PWM(outPin, 100)
    try:
    brightness = 50
    readVal_1_before = 1
    readVal_2_before = 1
    myPWM.start(brightness)
    while True:
    readVal_1_now = GPIO.input(inPin_1)
    readVal_2_now = GPIO.input(inPin_2)
    print(readVal_1_now, readVal_2_now)
    if readVal_1_now - readVal_1_before == 1:
    brightness = max(0,brightness-10)
    myPWM.ChangeDutyCycle(brightness)
    print(str(brightness) + "%")
    elif readVal_2_now - readVal_2_before == 1:
    brightness = min(100,brightness+10)
    myPWM.ChangeDutyCycle(brightness)
    print(str(brightness) + "%")
    readVal_1_before = readVal_1_now
    readVal_2_before = readVal_2_now
    sleep(delay)
    except KeyboardInterrupt:
    myPWM.stop()
    GPIO.cleanup()
    print(" cleanup has been done.")

  • @MensahJ
    @MensahJ 5 หลายเดือนก่อน

    I am legend