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.
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.
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.
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
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
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
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 🙂!
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
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
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.
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!
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...
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.
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.
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.
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?
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
@@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!
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
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
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
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
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
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.
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.
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.
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.
This series is amazing! I have been learning so much from it, especially from the homework assignments.
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
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
funny!
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
LEGEND!
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 🙂!
Great work you do Mr. Paul. we need more people like you willing to share the knowledge God Bless you and you family....
Anything that speeds the accuracy and ease of design for our work is great. Love the math. God Bless.
Thank you!
@@paulmcwhorter You are welcome.
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
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
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.
Thanks for showing us the Log function. I would like to see you do a lesson on logs.
😍😍 What an amazing content. I really admire you for you huge knowledge Mr Paul. Plus don't ever stop sharing it with us!
I am Legend. Mine worked at the second attempt! This is a great explanation of logs. Well done, and many thanks for this series.
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!
Fantastic lesson and the math is so awesome !!!!! A lesson on logarithms would be great and very helpfull for future lessons.
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...
Glad it was helpful!
Cool! I enjoyed the refresher on logarithms.
This is another Great Lesson! Hope you have a safe time in the bush!
Hi Paul. I found that I need to restrict the range of BP [ if BP>10: BP=10 and if BP
I am legend!
Will be watching for an opportunity to use exponents for steps.
LEGEND!
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.
very nice explanation sir
Well, This is the third time my comment is deleted... This time just say I'm legend, thanks Paul for making this lessons
really sir, your are great JAADUGAR😊😊😇💕
I would like to see livestreams where the audience can ask questions about math.
You are really a magic man.. 🙏🙏🙏
Great Lessons!!! Just wondering why you are not using Thonny since it is included in the Raspberry Pi OS?
I am legend. Thanks for the lesson on using log maths.
LEGEND!
Thanks for the math @Paul McWhorter! Feel free to do a log lesson or even a full ‘Math for Engineering’ tutorial series!
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.
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.
This is so much fun!
Hi Magicman Paul, could I use my components from arduino kits in Raspberry Pi project? Many thanks!!! Looking forwards to your reply😊
How did I miss this??? Paul did you change the schedule? This premiered at 3 AM where I live
Young me: I’ll never use this math stuff…
Mr. McWhorter: Oh my sweet summer child (takes a sip of his coffe)
cool it worked here
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?
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
Awesome !
I folded up like a cheap walmart lawn chair BROTHER
Yet you will get up, dust yourself off, and try again. Next time, LEGEND!
@@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!
Please try ‚,except InvisibleKeyInterrupt:‘‘ :). Thanks a lot for the tutorials!!
Bravo!!!
I am legend! finally lol
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
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
sir what is AI , ML,DL, DATA SCIENCE ,NLP
I am legend!
LEGEND!
I AM LEGEND!!!!!!!
LEGEND!
Coffee without sugar will be very bitter.
Not at all!
🙏🙏👍
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
Excellent
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
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
I am legend
LEGEND!
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.
Yes, you could have an input for the number of pushes you want (n) and then take the nth root of 100. :)
Iam legend (LOL)
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.")
I am legend