Using an Arduino with Python LESSON 10: Passing Data from Python to Arduino

Поділитися
Вставка
  • Опубліковано 11 вер 2024

КОМЕНТАРІ • 84

  • @Avissarin
    @Avissarin 2 роки тому +4

    this guy went all out for this video, news headline, ice coffee, boats in the background. I like this guy.

  • @g0fvt
    @g0fvt 2 роки тому +5

    Thank you for the considerable effort you have put into making the videos, I am not a youngster but have spent all of my life around electronics, playing with a few Arduinos was like a revelation, it felt like I discovered the magic component I always needed.

  • @cbrombaugh
    @cbrombaugh 2 роки тому +5

    Thanks for another most excellent lesson Paul. I wrote a program that stepped an RGB LED through 6 colors, as you suggested. When you show us how to communicate both ways between Python and Arduino we will become truly dangerous.

  • @nanobotb4362
    @nanobotb4362 2 роки тому +4

    Keep up the good work !!! I really love watching your videos and your style of teaching is by far the most amazing i have ever seen in my life!

  • @scottwait3585
    @scottwait3585 2 роки тому +2

    The arduino python series is one of my favorites. Thanks Paul

  • @Sikuq
    @Sikuq 2 роки тому +1

    Python data to Arduino is great for me. I’m running 4 Arduinos on i2c and spi simultaneously and your Lesson 10 was the missing link. Thank you Paul.

  • @edSabio572
    @edSabio572 2 роки тому

    Thanks Paul! Very clear explanation, no issues, no problem., "...None needed...". There is a lot of value in your lessons beyond the subject matter presented.

  • @chrisb7250
    @chrisb7250 6 місяців тому

    "If you're just a drive by shooter, make sure you have py.Serial installed on your python" hahaha so funny. Thank you for the great content Paul. You are always making it fun to learn as well.

  • @nickmorris1808
    @nickmorris1808 Рік тому +1

    Is there a more wholesome tutor in the whole of youtube? I don't think so.

  • @chrisb7250
    @chrisb7250 6 місяців тому

    From the shores of the mighty Nile! I love the view.

  • @kamesejordan9550
    @kamesejordan9550 3 місяці тому

    I have scoured the internet for such a simple yet intricate crash tutorial .... my presentation is on the same day that my arduino kit will be delivered .... at least I will be prepared .... THANK YOU (gotta do a live demonstration for a Computer Vision project )

  • @svenfritsch9702
    @svenfritsch9702 2 роки тому +1

    Excellent video!

  • @mailo66
    @mailo66 24 дні тому

    Very useful! Very nice guy!!

  • @lowgrind7076
    @lowgrind7076 Рік тому +1

    'if you're just a drive-by shooter' ahahahahaah!!

  • @floridian080
    @floridian080 2 роки тому

    This is a note about the large birds you mentioned in a previous series of lessons because they were pecking out your first floor windows: I discovered today that here is a tableau of Abyssinian hornbills at the Natural Science Museum in Houston.

  • @struggle375
    @struggle375 9 місяців тому

    Thank you for sharing your knowledge

  • @pralaymajumdar1206
    @pralaymajumdar1206 2 роки тому

    U r really a magic man sir.. Thank u.

  • @ardespmaker
    @ardespmaker 2 роки тому

    Hi Paul - I've not been able to get to the time slot for the premieres for the last few weeks, but still following the course. I've been waiting for this one and thanks for making it look so straight forward. Will you get into comms using JSON data format or is that too much for what we need in this series? Thanks again

  • @ranshmulevitch8351
    @ranshmulevitch8351 2 роки тому

    and of course, great videos. i am learning from scratch

  • @amrgodovich
    @amrgodovich Рік тому

    man, u r great!
    keep it up!

  • @mohamedelnazer4755
    @mohamedelnazer4755 Рік тому

    25:45
    i ♥ that booom hahahaha

  • @vsdsas
    @vsdsas Рік тому

    you are legend

  • @MrVishalrnaik
    @MrVishalrnaik Рік тому

    Dear Paul, great lesson. I have a question. Can we pass data from python to two different Arduino simultaneously?

  • @anantchandak9574
    @anantchandak9574 2 роки тому +1

    hey i learning arduino from you and i am a boxing expert and i want to make something like -
    3 box horizontally with 3 box vertically and it randomly light up a box and it should take the user input that - how many punch you want to do and a timer
    just give me some guidance how to do this

    • @bigbogeyface
      @bigbogeyface 2 роки тому

      You will need to learn the randomSeed fuction and the timer function, maybe use the keypad for the number input, that way the entire thing can run without a computer, maybe a potentiometer would be cool too, to adjust the speed 👍

  • @dough6982
    @dough6982 2 роки тому

    Hi Paul - shouldn't you set the pinmode in the setup section rather than the loop? Probably not a big deal but since we're not changing the pin mode within the program no reason to have it in the loop. Love these videos and I'm looking forward to getting more ideas from you.

    • @paulmcwhorter
      @paulmcwhorter  2 роки тому

      You are correct. It was a mistake to put pinmode in the loop. I have made my font large so you guys can see on the arduino IDE and it gives me a limited view of the code, so I did not notice. Not sure if I fixed it before the end of the video or not.

  • @kennethfajardo5121
    @kennethfajardo5121 Рік тому

    Hello Sir Paul McWhorter first of all thank you for this informative and easy to understand tutorial. I have a question Sir can it works if I will pass the data from arduino to python and then pass again the data configured by the python back to the arduino simultaneously? My plan is I will use a sensor arduino to get data and then send it to python for it to be solved by formulas and then give it back to the arduino for it to be display in lcd.

  • @gamingsoftware4934
    @gamingsoftware4934 Рік тому

    Paul my Serial monitor is not working.My string expression doesn't change color either.I can't send ON OFF data to serial monitor.Can u help me ?

  • @uzairahmed1715
    @uzairahmed1715 9 місяців тому

    can i know why i am getting this error?
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError())) serial.serialutil.SerialException: could not open port 'com3': PermissionError(13, 'Access is denied.', None, 5)

  • @a.ksingh11
    @a.ksingh11 9 місяців тому

    Good

  • @almenbrenoli2942
    @almenbrenoli2942 2 роки тому

    Hello Paul, I have a couple of questions for you. Maybe it isn’t about Arduino but it is about this sphere for sure. My team and I wanted to do implementation of speech recognition on Zybo Board(FPGA). I am currently watching your Python course, so I wanted to ask you what course to take from you along this course from Python ? We want to write algorithm in Python for this speech recognition.

  • @tactusxii
    @tactusxii Рік тому

    "Who's your "Huckleberry, me! 💀

  • @ejteachtech
    @ejteachtech 2 роки тому

    Thank you so much

  • @Kalendarprince
    @Kalendarprince Рік тому

    adamsın paul abim

  • @PhilipStanway
    @PhilipStanway 10 місяців тому

    I am legend!

  • @ranshmulevitch8351
    @ranshmulevitch8351 2 роки тому

    hello, i am using the Jetson nano and i am communicating via the serial pins ttyTHS1, because that is what i need for a specific project. 1st it required a special set of commands in order to release that port from other tasks it was occupied with. sending from the arduino to the jetson nano worked fine but sending from jetson nano to arduino via that port does not work that well. the arduino gets the transmission but fails to decode the characters, sometimes it gets them right but sometimes not. any ideas?

  • @electronics5449
    @electronics5449 2 роки тому

    I like you, man

  • @contraplano3157
    @contraplano3157 Рік тому

    thks

  • @alharethaltmimi699
    @alharethaltmimi699 2 роки тому

    thank you so much master Paul, I am looking for send decimal number from python to arduino and I couldn't do this please can you help .....

  • @ranshmulevitch8351
    @ranshmulevitch8351 2 роки тому

    the goal of the app was to send data from the arduino only when it is asked to. in order to bypass the issue of wrong characters i changed the program that whatever comes from the jetson, the arduino sends the data stream

  • @senanichathurangaperera7046
    @senanichathurangaperera7046 Місяць тому

    H r so impressive

  • @joestanco4341
    @joestanco4341 2 роки тому

    Great lesson! Got five LEDs working. All ON, all OFF and lite up from One to Five, However, it would be nice to remove the USB tether. Could a Bluetooth HC-05 be used to do this?

    • @floridian080
      @floridian080 2 роки тому

      You could make the project portable without removing the USB cable by running the Arduino off a Rasp Pi and running the Pi on a battery pack. I've done that with the Pi400. VSCode is included in the Pi applications.

  • @kamaumaina2000
    @kamaumaina2000 2 роки тому

    please complete the " learn fusion 360 or die trying" series

  • @benbenameur8429
    @benbenameur8429 2 роки тому

    Hello
    I am looking for the equivalent of : arduino.write("X="+str(200)+'
    ') in matlab .

  • @donkeypoopdragon
    @donkeypoopdragon 10 місяців тому

    Just a heads up everyone, pyserial is not able to be used with threading or multiprocessing.

  • @ahmadfaizbinidris94
    @ahmadfaizbinidris94 2 роки тому

    can i ask you, how to transfer data from terminal ubuntu to arduino (serial monitor)

    • @ranshmulevitch8351
      @ranshmulevitch8351 2 роки тому

      (i hope the question is still relevant)
      hardware connections: pin 8 (TX) on the jetson -> pin RX on the arduino, pin 10(RX) on the jetson -> pin TX on the arduino, you must connect one of the jetson GND to one of the arduino GND.
      the port is THS1
      on the python code you should set an object:
      arduino = serial.Serial(port='/dev/ttyTHS1', baudrate=9600,bytesize=serial.EIGHTBITS,parity=serial.PARITY_NONE,stopbits=serial.STOPBITS_ONE)
      you may use any baudrate but it must be the same as the arduino baudrate and the same as the arduino serial monitor.
      * important - before you run the python code for the first time you must run the following lines on the jetson terminal:
      systemctl stop nvgetty
      systemctl disable nvgetty
      udevadm trigger
      after that you should re-boot the jetson
      those lines enable access to the THS1 port that is otherwise occupied by the jetson.
      sending from the arduino to the jetson works fine. as for now, when i send from the jetson to the arduino the message is not always correct. i am still working on that

  • @tseckwr3783
    @tseckwr3783 2 роки тому +1

    We coffee connoisseurs only drink our coffee black ... especially when programming in C++ and python.

  • @starRunnerX
    @starRunnerX 2 роки тому

    I partialy succeeded with the homework. My idea was to make a replica of the max7219 LED matrix on vpython using widgets, so I could click on a button and turn on a specific light on the matrix, yet I can only seem to pass one piece of data from from one widget from python to arduino and can only control a single specific light at a time. I watched tons of videos and read many posts, unfortunately, they are all very old, and the lines of code the posters used did not work, or I could not even comprehend. I guess I'm 75% legend, and 25% lawn chair.

  • @larryplatzek9017
    @larryplatzek9017 2 роки тому

    Paul I hope the code will readable in this lesson the prior lesson was not! Not mad just hope people will be able to read the code or why show it.

    • @paulmcwhorter
      @paulmcwhorter  2 роки тому

      Larry, if you are having trouble reading the code, it is your internet connection. UA-cam blurs text when internet connections are slow. I can not make the code bigger because the lines would not fit on the screen.

    • @larryplatzek9017
      @larryplatzek9017 2 роки тому

      Yes, the problem appears to have been internet problems. I have watched lessons without problems. Thank you.sorry reply was delayed having with smoke alarm sounding off.

  • @shuttlepodone1707
    @shuttlepodone1707 2 роки тому +1

    Hi Paul, homework completed and I used this lesson and your New Arduino tutorial 37 to help. Link to homework - ua-cam.com/video/m0dSVvYJbzY/v-deo.html

  • @kenstephens221
    @kenstephens221 2 роки тому +1

    Here's my solution to the homework: ua-cam.com/video/1PPHhLCu-WY/v-deo.html. Thanks for the lesson. Learned from the homework, too.

  • @itsmeintorrespain2714
    @itsmeintorrespain2714 2 роки тому

    Homework uploaded:- ua-cam.com/video/tjdusCVzqlY/v-deo.html

  • @MrElFRanz
    @MrElFRanz 2 роки тому

    Hello Paul, this is my homework. The video at ua-cam.com/video/hRKhAe0DJaY/v-deo.html shows r, g and b values = 0, then = 1, then = 0, then = 22, then = 0, then = 222, and finally = 0.

  • @snowman58able
    @snowman58able 2 роки тому

    ua-cam.com/video/zTTLNpdA3V/v-deo.html. The link to my lesson 10 video

    • @paulmcwhorter
      @paulmcwhorter  2 роки тому

      I could not get the link to work.

    • @snowman58able
      @snowman58able 2 роки тому

      ua-cam.com/video/zTTLNpdA3VE/v-deo.html. This should work

  • @keithlohmeyer
    @keithlohmeyer 2 роки тому

    Homework complete ua-cam.com/video/FKzOY73Geh4/v-deo.html
    Thanks Paul for another great video.

  • @codewithcc
    @codewithcc 2 роки тому

    HOMEWORK : ua-cam.com/video/-pE7EIvgPCg/v-deo.html
    THANKS FOR THE LESSON 🇮🇳🇮🇳

  • @wendygrant2735
    @wendygrant2735 2 роки тому

    I 'borrowed' some led chaser code from the internet and made it work with Python.
    Sorry, no youtube, I don't own a camera.
    Python:
    import serial
    arduinoData=serial.Serial('com3',115200)
    print('Welcome to the LED chaser show')
    print('Press A,B,C,D,E,F,G or ALL')
    while True:
    cmd=input('Please enter your command: ')
    cmd=cmd+'
    '
    arduinoData.write(cmd.encode())
    Arduino:
    int led1 = 2;
    int led2 = 3;
    int led3 = 4;
    int led4 = 5;
    int led5 = 6;
    int led6 = 7;
    int led7 = 8;
    int led8 = 9;
    int led9 = 10;
    int led10 = 11;
    int led11 = 12;
    int led12 = 13;
    int t=30;
    int t1=20;
    int t2=100;
    int t3=50;
    String myCmd;
    void setup() {
    Serial.begin(115200);
    for (int i = 2; i 2; i--) {
    clear();
    digitalWrite(i, HIGH); // chaser 1
    digitalWrite(count, HIGH); // chaser 2
    count++;
    // stop LEDs from appearing to stand still in the middle
    if (count != 8) {
    delay(t2);
    }
    }
    }
    ////////////////////////////////////////////////////////////////////////////////Effect 3
    void effect_3()
    {
    for(int i=2; i=2; i--){
    digitalWrite(i, LOW);
    delay(t3);
    }
    }
    ///////////////////////////////////////////////////////////////////////////Effect 4
    void effect_4()
    {
    for(int j = 2; j 2; k--){
    digitalWrite(k, LOW);
    delay(t2);
    }
    }
    //////////////////////////////////////////////////////////////////////////////Effect 5
    void effect_5()
    {
    for(int pin = 13; pin >= 2; pin--)
    {
    digitalWrite(pin, HIGH);
    delay(t1);
    digitalWrite(pin+1, LOW);
    delay(t1);
    }
    for(int pin = 13; pin >= 2; pin--)
    {
    digitalWrite(pin+1, HIGH);
    delay(t1);
    digitalWrite(pin+2, LOW);
    delay(t1);
    }
    for(int pin = 13; pin >= 2; pin--)
    {
    digitalWrite(pin+2, HIGH);
    delay(t1);
    digitalWrite(pin+3, LOW);
    delay(t1);
    }
    for(int pin = 13; pin >= 2; pin--)
    {
    digitalWrite(pin+3, HIGH);
    delay(t1);
    digitalWrite(pin+4, LOW);
    delay(t1);
    }
    for(int pin = 13; pin >= 2; pin--)
    {
    digitalWrite(pin+4, HIGH);
    delay(t1);
    digitalWrite(pin+5, LOW);
    delay(t1);
    }
    for(int pin = 13; pin >= 2; pin--)
    {
    digitalWrite(pin+5, HIGH);
    delay(t1);
    digitalWrite(pin+6, LOW);
    delay(t1);
    }
    for(int pin = 13; pin >= 2; pin--)
    {
    digitalWrite(pin+6, HIGH);
    delay(t1);
    digitalWrite(pin+7, LOW);
    delay(t1);
    }
    for(int pin = 13; pin >= 2; pin--)
    {
    digitalWrite(pin+7, HIGH);
    delay(t1);
    digitalWrite(pin+8, LOW);
    delay(t1);
    }
    for(int pin = 9; pin >= 2; pin--)
    {
    digitalWrite(pin+8, HIGH);
    delay(t1);
    digitalWrite(pin+9, LOW);
    delay(t1);
    }
    for(int pin = 9; pin >= 2; pin--)
    {
    digitalWrite(pin+9, HIGH);
    delay(t1);
    digitalWrite(pin+10, LOW);
    delay(t1);
    }
    for(int pin = 9; pin >= 2; pin--)
    {
    digitalWrite(pin+10, HIGH);
    delay(t1);
    digitalWrite(pin+11, LOW);
    delay(t1);
    }
    for(int pin = 14; pin >= 2; pin--)
    {
    digitalWrite(pin+11, HIGH);
    delay(t1);
    }
    for(int pin = 13; pin >= 2; pin--)
    {
    digitalWrite(pin, LOW);
    delay(t1);
    }
    }
    /////////////////////////////////////////////////////////////////////////////Effect 6
    void effect_6()
    {
    for(int j=2; j2; k--){
    digitalWrite(k, LOW);
    delay(t);
    digitalWrite(k, HIGH);
    delay(t);
    digitalWrite(k+2, LOW);
    delay(t);
    digitalWrite(k, HIGH);
    }
    for(int k = 2; k2; k--){
    digitalWrite(k, LOW);
    delay(t);
    digitalWrite(k, HIGH);
    delay(t);
    digitalWrite(k+4, LOW);
    delay(t);
    digitalWrite(k, HIGH);
    }
    for(int k = 2; k