This is another great series, am having so much fun learning to program in 3D. For those going out of their minds because you can’t get the animation to the browser because of the package txaio causing errors. Try to use an older autobahn version 20.7.1 and txaio 20.4.1, old laptops had no issues with these files. Run the following four commands in a terminal, best of luck: pip uninstall autobahn pip uninstall txaio pip install autobahn==20.7.1 pip install txaio==20.4.1
I did about a C+ job on this homework. Used an arrow which stretched appropriately along a box with tick marks. When entering your solution, I struggled with a frequent intermittent error which occurred on the "...serial.Serial... line and seems to indicate an error opening the com port. After hours of experimenting, I found that moving the time.sleep line above the serial.Serial line and increasing the delay to a ridiculous 8 seconds eliminated the problem. Thanks for presenting these most excellent lessons, Paul!
finally managed to find a series I can follow life, although I have to catch up with the visual python lesson. hope to post my solution before the next lesson!
I am legend but did use my notes and sketches from taking your Arduino series. But I did build the 3D graphic and made it work awesomely. Thank you for another great series Paul!
I am legend! 😀Here is what I did. Unfortunately my machine is too old to run Python 3.8 and up (which is needed for VPython), so what I did instead was to create a GUI with a progress bar (using good ol' Tkinter), and as I turn the potensiometer, the progress bar updates accordingly. I trust that is a fair replacement for VPython for this tutorial. I had to use multi-threading to make it work, though. Imagine how cool it would be to measure various engineering parameters and displaying them all on a neat screen. That is my ultimate dream. No more expensive CompactDAQs needed. 😉 Blessings
I did this as homework for the previous lesson. I used A3 instead of A0. Here's my solution: ua-cam.com/video/gg6r3j7huHo/v-deo.html. Thank you Dr. McWhorter for the fun lessons.
Paul, For the problem of 'from vpython import *' I had to use the following commands: "py -3.9 -m pip install requests" and then "pip install vpython" now I can see the tube working with the Arduino potVal.
I found that instead of a cylinder, I could use a cone as an object to rotate. It's not as neat as others I've seen here, and it could use a scale, and a title. But I expect we'll get to that soon. Many thanks for another great video.
I tried "cylinder" on my macbook as shown in this lesson. My code is exactly the same as what Mr. McWhorter has toward the end of the lesson. However, I keep getting an error message, "AttributeError: 'cylinder' object has no attribute 'idx' ". Why am I getting this error when the 'idx' attribute is even not part of the code? Should I use a slightly different syntax since the example code is for Windows? Please, help!
Hi, Paul! Thank you for your lessons. Can you tell me how to measure the voltage for example batteries 0-3.3 volts using Python? Also, measurements must be made with different indicators of NPLC: 1,5,10
Hey Paul, looking forward to lesson 4! I’m sad to say that the safe cracker folded up like a cheap lawn chair and did not open the safe. I stopped it after 13000 combinations. I found an old spiral notebook with a note inside with the combination! The first number is 13 and the safe cracker had already gone past that set in the database. I’ve been trying the combination but it still won’t open. I must be using the wrong sequence. I still plan to do a video. I’m finding that to be very difficult. The software I used to do videos with doesn’t seem to work anymore so I need new software. I’m trying iMovie which came with my MacBook. I refuse to fold up on this. I will get it done eventually! If you have any suggestions on video editing software I’m open to suggestions.
On the safe, an important thing is to make sure whether you are supposed to start spinning to the left, or start spinning to the right. A safe will have two different combinations, depending on which direction you start. Second, making sure you are spinning a suitable number of times in the start direction before commencing with the combination. The other thing you mentioned is that you were jumping 3 at a time . . . maybe go back, and just do one at a time. If you found a combination, it should open it, if you are entering the combination properly. These old safes really will open, you just have to have confidence. Maybe see if you can find more info on your make of safe about the unlock sequence. I have found even having the combination can require some fiddling to get it opened.
Thanks Paul! I did have a problem "Import "vpython" could not be resolved" You are working on VS 3.9 according to your screen, Isn't it supposed to work on only 2.t version? If there is another video, I'm supposed to watch, please let me know...
@@terryterry1655 Terry, this what I did and it worked for me: Note: to install vpython if using a 64bit python version, go to viw menu and press terminal. On terminal screen type(all lower case: pip install requests vpython then: pip install vpython
You should do a new set of arduino tutorials exept like a follow up to you most recent ones, so like more complicated builds but still explaining the science and math behind them. Also you could use new components in them like a keypad or segment display
Got it all running but the Lable i did not get python to recognize the Lable class (the cylinder class worked fine) is there something i need to down load?
I had no issue at all passing pot data to python and manipulating it to whatever value I desired in python. But for some reason, I'm having issues passing it to vpython. Like I tried making pot value 0-1 and change opacity. But the sphere stayed with old value. (Edit) I was over complicating the "sphere.opacity=potOpac"
Would it not have been easier and more instructive to show how to convert the base 2 value of the pot which is the same value as found want only in base 10? In my experience, changing bases should be such a common function that programmers can do it in their heads.
I was able to get the voltage from the potentiometer followed by " Volts" printed in the Python Terminal, but it did not loop. It only printed the immediate voltage and " Volts"..and that was it. This is what I did. Arduino IDE Code: 1 int potent0 = A0; //Analog pin for Potentiometer// 2 int readVal; //declaring variable, readVal 3 float V2; //declaring non-integer value for varrying potentiometer setting// 4 int dt = 200; 5 void setup() { 6 Serial.begin(115200); 7 pinMode(potent0,INPUT); 8 } 9 void loop() { 10 readVal=analogRead(potent0); 11 V2=(5./1023.)*readVal; 12 Serial.print(V2); 13 Serial.print(","); 14 Serial.println("Volts"); 15 delay(dt); 16 }
Visual Studio Code: 1. import time 2. import serial 3. arduinoData=serial.Serial('com5',115200) 4. time.sleep(1) 5. dataPacket=arduinoData.readline() 6. dataPacket=str(dataPacket,'utf-8') 7. splitPacket=dataPacket.split(",") 8. x=splitPacket[0] 9. y=splitPacket[1] 10. print(x,y)
when I originally tried to make the loop I forgot indentation after "while True:" for rest of code. Problem solved very soon in video. Correct Python Code: 1 import time 2 import serial 3 arduinoData=serial.Serial('com5',115200) 4 time.sleep(1) 5 while True: 6 while arduinoData.inWaiting==0: 7 pass 8 dataPacket=arduinoData.readline() 9 dataPacket=str(dataPacket,'utf-8') 10 splitPacket=dataPacket.split(",") 11 x=splitPacket[0] 12 y=splitPacket[1] 13 print(x,y)
@@paulmcwhorter Thank you for everything. Sorry I was mistake. The inWaiting function was used in lesson 3 and the in_waiting in this lesson and both lessons are dealing with the same subject, Arduino and Python :)
My set up does everything until the visual part. I only get a blank page. What os Wrong? I guess my python days are over unless I find out what the problem is. Must be in my computer or browser settings
Probably something with your browser settings. It is hard for me to say because there are so many different systems you might be running on, and your security settings might prevent a script from showing in a browser. I really dont know what to suggest.
Hello Paul, thanks for amazing lessons, you are LEGEND. but i have a problem with this error dataPacket = int(dataPacket) ValueError: invalid literal for int() with base 10: '' Can any1 help please? Cheers and thank you :)
I am having the same problem but only once when I first start the program. The next time I run it and every time after that, it runs fine. No idea the issue.
Well, it appears that I may be a cheap lawn chair. Here is my submission. That being said, just because its folded doesn't mean its junk. It could've been set up improperly by the user. Jokes to the side. Thanks Paul. (edit) almost forgot the link to my homework; ua-cam.com/video/Rj3faSty3gM/v-deo.html.
please look up to this problem : ValueError: invalid literal for int() with base 10: '' i am getting this error import time import serial from vpython import * import numpy as np arduinodata=serial.Serial('com11', 115200) meter=cylinder(color=color.red ,length=1 , raduis=1 , pos=vector(0,0,0) , axis=vector(0,0,1) ) m1=box(length=2 , width=1 , height=1 , pos=vector(0,-0.5,0.6), color=color.black) time.sleep(1) while True: while (arduinodata.inWaiting()==0): pass wt=arduinodata.readline() wt=str(wt,'utf-8') wt=wt.strip(' ') wt=int(wt) print(wt)
i think watching this tutorial after finishing arduino tutorial is too hard for me because i cant do python. the homework you give, needs too many python code knowledge maybe i should watch your AI tutorial?
REally, I am teaching Python as we go. Did you watch the earlier lessons in this series? If this is going to fast, go back and watch my python class on another playlist on this channel
Oh. The homework is what I did for last week, I have improved my code to sweep the pointer when getting new readings from the Arduino, I also added a digital display but think I should have used a different colour as the red is no easy to see in the video, learnt how to screen capture as well rather than my normal wobbly phone video. ua-cam.com/video/ibYHKnpgFQs/v-deo.html
Hmmm, my Arduino Serial monitor is showing 1.12, 3.14 etc etc, but parsed data is 1.0, 2.0, 3.0, 4.0 I couldn't seem to get the whole float to come over, so I'm claiming a partial grade. ua-cam.com/video/7TRbk511uV4/v-deo.html
ua-cam.com/video/xHBrytvDOVQ/v-deo.html Heres my homework solution, sorry for it being a bit late as i had a lot of schoolwork this week, thanks really much once again
I AM LEGEND: ua-cam.com/video/EODI1mMhXj4/v-deo.html. Great lesson. i'm currently running python 3.12.4 and vpython runs without any modifications or tricks.
This is another great series, am having so much fun learning to program in 3D. For those going out of their minds because you can’t get the animation to the browser because of the package txaio causing errors. Try to use an older autobahn version 20.7.1 and txaio 20.4.1, old laptops had no issues with these files.
Run the following four commands in a terminal, best of luck:
pip uninstall autobahn
pip uninstall txaio
pip install autobahn==20.7.1
pip install txaio==20.4.1
Hi Paul, the computer setup is looking good. Thanks for all you’ve done!
Hi Paul, I did this week's homework last week. Thanks for another great tutorial.
Fantastic!
Thanks Paul! Great class. I was able to work out my vpython import and now see the tube object working with the
Arduino.
Happy new year 🎆🎈🎊! May your 2022 be fantastic! Also thanks for your hard work and helpful videos!
Happy new year!
I did about a C+ job on this homework. Used an arrow which stretched appropriately along a box with tick marks. When entering your solution, I struggled with a frequent intermittent error which occurred on the "...serial.Serial... line and seems to indicate an error opening the com port. After hours of experimenting, I found that moving the time.sleep line above the serial.Serial line and increasing the delay to a ridiculous 8 seconds eliminated the problem. Thanks for presenting these most excellent lessons, Paul!
Thanks Paul. Appreciate your time and efforts.
Hi Paul! Glad to see you still active in 2022! Had quit Arduino for a while now. Anyhow, God bless you and take care always sir!
I missed your videos sir! You helped me ace high-school arduino programming!!!
Glad to hear that!
finally managed to find a series I can follow life, although I have to catch up with the visual python lesson. hope to post my solution before the next lesson!
You can do it!
I am legend but did use my notes and sketches from taking your Arduino series. But I did build the 3D graphic and made it work awesomely. Thank you for another great series Paul!
That's great!
I am legend! 😀Here is what I did. Unfortunately my machine is too old to run Python 3.8 and up (which is needed for VPython), so what I did instead was to create a GUI with a progress bar (using good ol' Tkinter), and as I turn the potensiometer, the progress bar updates accordingly. I trust that is a fair replacement for VPython for this tutorial. I had to use multi-threading to make it work, though.
Imagine how cool it would be to measure various engineering parameters and displaying them all on a neat screen. That is my ultimate dream.
No more expensive CompactDAQs needed. 😉
Blessings
Many thanks Paul my son is waiting for this badly
His patience will be richly rewarded!
I did this as homework for the previous lesson. I used A3 instead of A0. Here's my solution: ua-cam.com/video/gg6r3j7huHo/v-deo.html. Thank you Dr. McWhorter for the fun lessons.
Excellent!
Good job! Looks like an old fashion car gauge.
Paul, For the problem of 'from vpython import *' I had to use the following commands:
"py -3.9 -m pip install requests" and then "pip install vpython" now I can see the tube working with
the Arduino potVal.
Thanks a lot, best regards from Algeria👋
Welcome!
You’re my inspiration. I’m even drinking my coffee black now
Mission Accomplished! The world has another ice coffee drinker, which is really the secret agenda behind all of this.
I found that instead of a cylinder, I could use a cone as an object to rotate. It's not as neat as others I've seen here, and it could use a scale, and a title. But I expect we'll get to that soon. Many thanks for another great video.
Greetings from Norman Oklahoma!
Great lesson.. Thanks. Just what I was looking for.
Glad it was helpful!
I tried "cylinder" on my macbook as shown in this lesson.
My code is exactly the same as what Mr. McWhorter has toward the end of the lesson.
However, I keep getting an error message, "AttributeError: 'cylinder' object has no attribute 'idx' ".
Why am I getting this error when the 'idx' attribute is even not part of the code?
Should I use a slightly different syntax since the example code is for Windows?
Please, help!
Gotta love the math. Appreciated
Thank you Sir 🙏🙏🙏🙏😊😊😊
Hi, Paul! Thank you for your lessons. Can you tell me how to measure the voltage for example batteries 0-3.3 volts using Python? Also, measurements must be made with different indicators of NPLC: 1,5,10
Hey Paul, looking forward to lesson 4! I’m sad to say that the safe cracker folded up like a cheap lawn chair and did not open the safe. I stopped it after 13000 combinations. I found an old spiral notebook with a note inside with the combination! The first number is 13 and the safe cracker had already gone past that set in the database. I’ve been trying the combination but it still won’t open. I must be using the wrong sequence. I still plan to do a video. I’m finding that to be very difficult. The software I used to do videos with doesn’t seem to work anymore so I need new software. I’m trying iMovie which came with my MacBook. I refuse to fold up on this. I will get it done eventually! If you have any suggestions on video editing software I’m open to suggestions.
On the safe, an important thing is to make sure whether you are supposed to start spinning to the left, or start spinning to the right. A safe will have two different combinations, depending on which direction you start. Second, making sure you are spinning a suitable number of times in the start direction before commencing with the combination. The other thing you mentioned is that you were jumping 3 at a time . . . maybe go back, and just do one at a time. If you found a combination, it should open it, if you are entering the combination properly. These old safes really will open, you just have to have confidence. Maybe see if you can find more info on your make of safe about the unlock sequence. I have found even having the combination can require some fiddling to get it opened.
Det cord 👍
Thanks Paul!
Very impressive.. Thank u sir.
Thanks Paul! I did have a problem "Import "vpython" could not be resolved" You are working on VS 3.9 according to your screen,
Isn't it supposed to work on only 2.t version? If there is another video, I'm supposed to watch, please let me know...
i have the same problem .yet to be resolved
@@terryterry1655 Terry, this what I did and it worked for me:
Note: to install vpython if using a 64bit python version, go to viw menu and press terminal. On terminal screen type(all lower case:
pip install requests vpython
then:
pip install vpython
or see comment below...
I am legend. I finished this while in my electrician apprentice class. Kind of ironic that I made a volt meter there.
Thanks again for most excellent video...♥️
So nice of you
Good luck and thank you for this awesome videos❤
Glad you like them!
Paul Mcwhorter rocks
I am legend. Future homework will be posted, I had to skip out this first lesson.
You should do a new set of arduino tutorials exept like a follow up to you most recent ones, so like more complicated builds but still explaining the science and math behind them. Also you could use new components in them like a keypad or segment display
Got it all running but the Lable i did not get python to recognize the Lable class (the cylinder class worked fine)
is there something i need to down load?
if you are spelling label as 'lable' then that could be why...
Come for the code, stay for the math!
So much fun!!
I forgot to convert to voltage! I’ll get right on it.
I had no issue at all passing pot data to python and manipulating it to whatever value I desired in python. But for some reason, I'm having issues passing it to vpython. Like I tried making pot value 0-1 and change opacity. But the sphere stayed with old value.
(Edit) I was over complicating the "sphere.opacity=potOpac"
Would it not have been easier and more instructive to show how to convert the base 2 value of the pot which is the same value as found want only in base 10? In my experience, changing bases should be such a common function that programmers can do it in their heads.
i really wish next time you do it with kivy
I was able to get the voltage from the potentiometer followed by " Volts" printed in the Python Terminal, but it did not loop. It only printed the immediate voltage and " Volts"..and that was it. This is what I did.
Arduino IDE Code:
1 int potent0 = A0; //Analog pin for Potentiometer//
2 int readVal; //declaring variable, readVal
3 float V2; //declaring non-integer value for varrying potentiometer setting//
4 int dt = 200;
5 void setup() {
6 Serial.begin(115200);
7 pinMode(potent0,INPUT);
8 }
9 void loop() {
10 readVal=analogRead(potent0);
11 V2=(5./1023.)*readVal;
12 Serial.print(V2);
13 Serial.print(",");
14 Serial.println("Volts");
15 delay(dt);
16 }
Visual Studio Code:
1. import time
2. import serial
3. arduinoData=serial.Serial('com5',115200)
4. time.sleep(1)
5. dataPacket=arduinoData.readline()
6. dataPacket=str(dataPacket,'utf-8')
7. splitPacket=dataPacket.split(",")
8. x=splitPacket[0]
9. y=splitPacket[1]
10. print(x,y)
when I originally tried to make the loop I forgot indentation after "while True:" for rest of code. Problem solved very soon in video. Correct Python Code:
1 import time
2 import serial
3 arduinoData=serial.Serial('com5',115200)
4 time.sleep(1)
5 while True:
6 while arduinoData.inWaiting==0:
7 pass
8 dataPacket=arduinoData.readline()
9 dataPacket=str(dataPacket,'utf-8')
10 splitPacket=dataPacket.split(",")
11 x=splitPacket[0]
12 y=splitPacket[1]
13 print(x,y)
19:04 In lesson 2 you used InWaiting() and in this lesson you use t in_waiting() ? .
Isnt it the difference between being on the arduino vs. python side?
@@paulmcwhorter Thank you for everything. Sorry I was mistake. The inWaiting function was used in lesson 3 and the in_waiting in this lesson and both lessons are dealing with the same subject, Arduino and Python :)
this is will be my Van Ui!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 😘
lol, no worry I made the same typo as you did for "arduino" 😆 I guess I am not alone
My set up does everything until the visual part. I only get a blank page. What os Wrong? I guess my python days are over unless I find out what the problem is. Must be in my computer or browser settings
Probably something with your browser settings. It is hard for me to say because there are so many different systems you might be running on, and your security settings might prevent a script from showing in a browser. I really dont know what to suggest.
THANK YOU!!!
I did it but I just used a simple arrow and it doesn't look all that slick. Can someone point me to a lesson on uploading stuff to youTube?
Hello Paul, thanks for amazing lessons, you are LEGEND. but i have a problem with this error
dataPacket = int(dataPacket)
ValueError: invalid literal for int() with base 10: ''
Can any1 help please?
Cheers and thank you :)
I am having the same problem but only once when I first start the program. The next time I run it and every time after that, it runs fine. No idea the issue.
This is some violence against walmart lunch chairs.
Well, it appears that I may be a cheap lawn chair. Here is my submission. That being said, just because its folded doesn't mean its junk. It could've been set up improperly by the user. Jokes to the side. Thanks Paul. (edit) almost forgot the link to my homework; ua-cam.com/video/Rj3faSty3gM/v-deo.html.
I am legend. Video coming soon. Btw I don't know how to do vpython yet
I am legend. I have an analog voltmeter which also has a digital readout to 2 decimal place.
i am legend!
I am a real legend
please look up to this problem :
ValueError: invalid literal for int() with base 10: ''
i am getting this error
import time
import serial
from vpython import *
import numpy as np
arduinodata=serial.Serial('com11', 115200)
meter=cylinder(color=color.red ,length=1 , raduis=1 , pos=vector(0,0,0) , axis=vector(0,0,1) )
m1=box(length=2 , width=1 , height=1 , pos=vector(0,-0.5,0.6), color=color.black)
time.sleep(1)
while True:
while (arduinodata.inWaiting()==0):
pass
wt=arduinodata.readline()
wt=str(wt,'utf-8')
wt=wt.strip('
')
wt=int(wt)
print(wt)
I'm legend.👍
i think watching this tutorial after finishing arduino tutorial is too hard for me because i cant do python.
the homework you give, needs too many python code knowledge
maybe i should watch your AI tutorial?
REally, I am teaching Python as we go. Did you watch the earlier lessons in this series? If this is going to fast, go back and watch my python class on another playlist on this channel
My solution to the assigned exercise: ua-cam.com/video/d-37vWWzsBM/v-deo.html
Nice Job! Very realistic volt meter. Excellent
I am Legend
it said it may cause a short circuit and potential damage
I am a legennnnnnnnnnddddd. ;D
LEGEND!
Homework built partially from old code: ua-cam.com/video/VbqoJfQ-8fk/v-deo.html
Excellent
Oh. The homework is what I did for last week, I have improved my code to sweep the pointer when getting new readings from the Arduino, I also added a digital display but think I should have used a different colour as the red is no easy to see in the video, learnt how to screen capture as well rather than my normal wobbly phone video.
ua-cam.com/video/ibYHKnpgFQs/v-deo.html
Excellent!
My homework for this week is at ua-cam.com/video/iiTMipekw-I/v-deo.html
Looking forward to the next lesson.
Excellent
Here's my homework:
ua-cam.com/video/BbbJqw-UiGg/v-deo.html 👍
As always, exceptional solution.
@@paulmcwhorter
Thanks 🙂
I am legend
LEGEND!
Robert Murphree the code is clunky, vpython extension arc background dial scale too much work.
Here is my submission
my submission ua-cam.com/video/YrEGBdBXmg0/v-deo.html
Looks good. Yes, think about the problem and see if you can get the needle going the right direction.
Hmmm, my Arduino Serial monitor is showing 1.12, 3.14 etc etc, but parsed data is 1.0, 2.0, 3.0, 4.0 I couldn't seem to get the whole float to come over, so I'm claiming a partial grade.
ua-cam.com/video/7TRbk511uV4/v-deo.html
i am not able to complete my homework becoz i don't have arduino yet
This is my solution to the voltmeter: ua-cam.com/video/j93ZtJUtjZw/v-deo.html
LEGEND!
ua-cam.com/video/xHBrytvDOVQ/v-deo.html
Heres my homework solution, sorry for it being a bit late as i had a lot of schoolwork this week, thanks really much once again
Excellent!
I AM LEGEND: ua-cam.com/video/EODI1mMhXj4/v-deo.html. Great lesson. i'm currently running python 3.12.4 and vpython runs without any modifications or tricks.
Thank you Paul!
i am legend!
LEGEND!
I am legend
LEGEND!
I am legend