how to import Arduino Serial to Blender

hello,

i was wondering if there is a way to import the Rotation of a potentiometer into blender 3d view with a arduino. i have found a few articles but all of them are outdated.

any help would be appreciated.

EDIT i am looking for a way to access the serial data coming from a USB, but it seems that the serial module has been removed, how else can i do this.

I am looking for the same thing. I have found an script, (pure, python) but you has to add the serial modul to the library.
you can get this here: https://pypi.python.org/pypi/pyserial


import serial

#Global Variables
ser = 0

#Function to Initialize the Serial Port
def init_serial():
    COMNUM = 3          #Enter Your COM Port Number Here.
    global ser          #Must be declared in Each Function
    ser = serial.Serial()
    ser.baudrate = 115200
    ser.port = COMNUM - 1   #COM Port Name Start from 0
    
    #ser.port = '/dev/ttyUSB0' #If Using Linux

    #Specify the TimeOut in seconds, so that SerialPort
    #Doesn't hangs
    ser.timeout = 10
    ser.open()          #Opens SerialPort

    # print port open or closed
    if ser.isOpen():
        print('Open: ' + ser.portstr)
        
#Function Ends Here
        

#Call the Serial Initilization Function, Main Program Starts from here
init_serial()

temp = input('Type what you want to send, hit enter:
')
ser.write(temp)         #Writes to the SerialPort

while 1:    
    bytes = ser.readline()  #Read from Serial Port
    print('You sent: ' + bytes) #Print What is Read from Port
    
#Ctrl+C to Close Python Window

but I know it doesn’t work with an Ergometer, or in other words: I don’t know how I can get it to work.

hope it helps

thanks Cannibal for the script, what adjustments do i need to do to this script to get it to work?