-1

I've created a python code (Tkinter GUI) that is supposed to communicate with Arduino via serial communication.

I have a table that I need to send over, column by column. but before I send the next column I need to wait for the Arduino to finish processing the previous one.

Here is a code that iterates through the table:

def send():

    for row in rows:
        for col in row:
            print(col.get()),
        print(" ")

Here is how the table was created:

rows = []

for i in range(1, 20):

    cols = []
    for j in range(6):
        e = Entry(secondFrame, relief=RIDGE, justify=CENTER)
        e.grid(row=i, column=j, sticky=NSEW)
        #e.insert(END, '%d.%d' % (i, j))
        e.insert(END, '-')
        cols.append(e)
    rows.append(cols
SiHa
  • 7,830
  • 13
  • 34
  • 43
  • 1
    theres nothing here with serial ... how does the arduino program signal that it has finished processing the previous column? – Joran Beasley Aug 12 '19 at 06:59

1 Answers1

1

the arduino will surely signal somehow once it is ready for more data ... for example perhaps it sends a '>' ... ill assume you have a ser variable that is an instance of pyserial.Serial (since you didnt include any thing indicating a serial connection)

ser.write(columnData)
response = ser.read_until(">")
print("Probably can send the next column...")
Joran Beasley
  • 110,522
  • 12
  • 160
  • 179