download python here https://www.python.org/downloads/
Then go to the python source file location
And copy it
Next open command prompt
And type in these commands
cd <paste the source of the python file here>
py -m pip install -- upgrade pip
py -m pip install pyserial
Pyserial is for reading the arduinos serial port
Next open the python ide
And copy this code into it
#///////////////////
#/ 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)
Finally
Go into device manager
And below network adapters there should be "Arduino Uno (COM3)"
if not contact me in comments
Last of all setup the arduino project itself
/*
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);
}
All thats left is to run the arduino project
Then run the python project
If any issues arise contact me in the comments and I will reply relatively fast
You should see the string of numbers from the potentiometer appear in the idle
This is useful because python is very well rounded and powerful so having Arduino being able to link up to it is incredibly useful
Comments