polyhedra64
Published © GPL3+

How to link arduino serial to python!

Acsess the arduino serial port in python (Some delay)

IntermediateFull instructions provided1,974
How to link arduino serial to python!

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE
Python 3

Story

Read more

Schematics

Wiring connectinons

Just read it

Code

Serial arduino project.py

Python
This is the python
#///////////////////
#/ By polyhedra64  /
#///////////////////

import serial
import time

Arduino =serial.Serial('com3',9600)

while 1:
   data  =  str(Arduino.readline().decode('ascii'))   #read the data
   print(data)
   time.sleep(0.1)

Python_serial_project.ino

C/C++
/*
by polyhedra64
*/

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(analogRead(A0));
  delay(100);
}

Credits

polyhedra64

polyhedra64

4 projects • 2 followers

Comments