Це відео не доступне.
Перепрошуємо.

Python Tutorial - How to Read Data from Arduino via Serial Port

Поділитися
Вставка
  • Опубліковано 18 сер 2024
  • ** Copy/paste the code from here: www.tinkerassi... **
    These tutorials assume some basic understanding of Python syntax. If you are a beginner, there are plenty of resources available to quickly learn enough syntax to follow along.
    I am using Visual Studio Code editor to write these examples. To learn how to install VS Code and get set up for Python development, visit code.visualstu...
    Visit tinkerassist.com and Subscribe to the Tinker Assist Newsletter - keep up to date on what we are working on, and get your fix of programming, science, and engineering content straight to your inbox!

КОМЕНТАРІ • 66

  • @m.s.79
    @m.s.79 2 роки тому +6

    It is so great when one of the fist things that look for is exactly the one you need. Thank you very very much for this video.

  • @cdhiva
    @cdhiva 3 роки тому +13

    Hey Andrew! Great tutorial! My guess is that you are new to python and have experience in either C/C++ or Java from your for loop. In python, you can iterate over a list (portList, in your case) with just add the below code after line 4.

    for port in ports: # You could replace “ports” with serial.list_ports.comports() to remove line 3 in your code.
    if port.startswith(“COM” + str(val)):
    portVar = “COM” + str(val)

    ^this would eliminate the necessity of code from line 6 to line 16.
    Kudos to you for helping me learn serial communication using Python.

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

      Also there will be an issue if you have a COM30 or COM31 or…

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

      program harus berjalan di C:\Users\jhoea\AppData\Local\Programs\Python\Python311\Lib\site-packages

  • @Bularistan4o
    @Bularistan4o 2 роки тому +9

    After literally 3 hours of trying to install pyserial, your code finally came alive. 100% what I wanted. Now I just have to see how to write the data in a file, preferably .csv. As someone that has only coded minecraft blocks on a RPi3, how I find another video like this hahaha

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

    Thanks a lot mate! Great tutorial, explained better than the actual documentation. 👍

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

    It would be great if you make a complete video starting from how you setup the arduino and the temp sensor ^^.

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

    you are literally a God on earth. Thank's for saving me

  • @tank_tales
    @tank_tales Рік тому +3

    God please bless this guy with a lot of pizzas and money and grant his every single wish

  • @engineering-problems
    @engineering-problems 7 місяців тому

    Great explanation thank you , saved me ton of time.

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

    Thank you so much. This is great tutorial. Recommended!

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

    Hello ! Thanks for the tuto ! Does it works with Linux on a raspberry pi ?

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

    Thank you for this, it was very helpful!

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

    Thanks a lot dude for this wonderful tutorial. It helps me a lot.☺✌

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

    Can you do the reverse send from python to serial monitor? I really need it

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

    How to display for 2 values like temp,pressure???

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

    Great tutorial!

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

    thnx dude.. this video really helped a lot!

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

    Great video! Would you know how to read the same kind of data but coming from a WiFi connected Arduino such as the Arduino Uno R4 WiFi (not connected to a USB port)?

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

    Thanks a lot! Great tutorial!

  • @syedfawad8245
    @syedfawad8245 3 роки тому +1

    Hello, very nice tutorial. I have been working on the opposite to this video content i.e. i have to send a list of integers from python to arduino. but i end overflowing the serial port and arduino going crazy. Please do a tutorial on that. THanks

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

    thamks so much for this i apreciate it

  • @user-pn5th8kl6k
    @user-pn5th8kl6k Рік тому

    Thanks a lot. This is what I want to learn.

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

    Great video. I am going to connect to my fire panel serial port. How do I set the parameters for bit, parity and stop bit ?

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

    It is supposed that I have already installed pyserial like 3 times or so, and on Spyder it says that there is no module called serial, and on Visual it does not allow to use the port, and on issues it appears as a missing import. I need solve it asap.

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

    Thank you men!!!

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

    Thanks a lot for this awesome method. Can you help me further I have a question. I am using ESP32, and want to send AT command to it and then read the Response and use if conditions to do some actions based on the response. Can we do this with python? Please suggest!

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

    I try to this python code with stm32 uart, but it's constantly on the line. after each character. How can I fix it ?

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

    Serial not halted after a few hours?

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

    i can send data from tkinter and serial to another serial port and read it
    but cand receive
    my app crashing when want to read
    do you why?

  • @firesports8953
    @firesports8953 3 роки тому

    hello, very nice tutorial, i have question is it possible to make it single line data?

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

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

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

    Amazing video. Is there a chance you could make a py script video that could teach us how to send and receive serial data? ie. arduino sends "Ready" via serial. Python sees "ready" via serial and sends "im ready too"

  • @a-xp6ly
    @a-xp6ly 5 місяців тому

    I get a permission error when trying to read data from the port, anyone know why and how to fix?

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

    Great content, thanks

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

    good video. but i take TypeError: Serial.open() missing 1 required positional argument: 'self' error .How can i fix this?

  • @NawtieBoy96
    @NawtieBoy96 3 роки тому

    thanks alot , very nice tutorial

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

    Great Work

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

    Thank you so much 😀😀😀😀😀😀

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

    thank you grate video!!

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

    Thank you!

  • @noobpook5617
    @noobpook5617 11 місяців тому

    Thanks alot bro for your help

  • @oggythepro
    @oggythepro 2 місяці тому

    Love you My Boy It helps so much Thank you!!!!!❤❤❤❤❤❤❤❤❤❤❤❤😍😍😍😍😍😍💖💖💖💖💖💖🌹🌹🌹🌹🎉🎉🎉🎉🎉🎉

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

    Anyone else having issues with val = input("Select Port: COM")?
    For some reason Spyder crashes when this point is reached. What am I missing?
    P.S: For my IT friends, yes, I have tried turning it off and on (if you know, you know) ;)

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

      @@TinkerAssist_ thank you for the reply! i havent, and i surely will. hopefully it will work for me, as it did for the others in the github thread

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

    hey can you tell how to store data directly to MySQL from here
    need help asap

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

    Can you take this one step further and make a video of how to save the serial port data to a .txt or .csv file?

    • @TinkerAssist_
      @TinkerAssist_  8 місяців тому

      Python Tutorial - How to Read/Write Data To/From .CSV Files and Basic Data Parsing/Manipulation
      ua-cam.com/video/Nuo8-UrCDrM/v-deo.html

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

    Hi Sir.
    Can you please explain how we can control gpio pins of raspberry pi pico with python program via serial com port ??

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

    hello nice video, but i'm getting an error on 20.-21. line
    the error is :
    open() missing 1 required positional argument: 'self'

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

      thanks
      I figure out my solution

  • @rikerthiessen5027
    @rikerthiessen5027 3 роки тому

    I have an Arduino printing data to the serial port every 100 milliseconds, but when I read the data in python and print it to the console, it does not print nearly as fast (maybe every 500 milliseconds?). Do you know of any fix for this?

    • @rikerthiessen5027
      @rikerthiessen5027 3 роки тому

      @@TinkerAssist_ I print 5 values, each separated by a comma, and the last one prints using Serial.println(), and that is followed by delay(100). I bumped up the baud to 115200 and it is printing slightly faster. I decided to use the time library to get the time difference between starting the method and finishing the method, where I print, and python is telling me it actually is 0.10xxxx seconds. However, I did realize that for some reason the prints show up in packs of 3 (I print the array of 5 values from the arduino in one line, my python output is printing the one line in packs of 3 though. it prints the last 3 input readings every 0.3 seconds, even though it is set to print every time the method gets called)... not sure why.

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

    Does it matter what kind of arduino I have?

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

      It shouldn't matter.

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

    catatan : program harus berjalan di folder pithon.. dan port serial arduino dan python tidak boleh beradu/sama

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

    how to save data bro ? thanks

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

      @@TinkerAssist_ ok, i am waiting for it, thanks

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

    source code link pls???

  • @versys-vietnam
    @versys-vietnam 2 роки тому

    I cant do that T-T