Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Logging Arduino data on computer via serial port

Status
Not open for further replies.

ben7

Member
I have a project where I need to log data on a file on a computer, which is connected to an arduino, which will read sensors.

I played around with reading the serial port using python. The Arduino just does a loop where it increments a variable by one, and prints the variables' value to the serial port. But, when I read the data from the port in python, the data I get is old(from before the python program even started). Also, when I start the python program again, it starts with the old data (i.e. 1,2,3,4...). Python has no built-in way to read serial ports, so I installed PySerial[URL].

How do I get the latest data that is printed to the serial port?

Also, could someone clarify how the serial ports work?

Thanks,
Ben
 
Hard to debug code without seeing it.
 
Hard to debug code without seeing it.
Yeah I know sorry, but I have had a change of plan. The main program is on the computer, and it periodically tells the arduino to send back certain data, and it does so. Its going along much better this time :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top