← General Discussion
Kanatmetin@kanatmetin· 487 viewsin General Discussion

python3 If Input On Jump to Tab

Have you been running the go to tab command if the entry is open I am having a problem here with the verdict I was investigating in python3

ser.write (command.encode ())

ser.flushınput ()

time.sleep (.2)

value = ser.readline ()

if (value == b'T '):

ascii problem in this section

Comment 1

Kanatmetin

I reached the result with an arrangement like this.

code on the arduino side

Arduino / C++
 //-----COMMAND IF INPUT THEN JUMP---------------------------------------------------

 //-----------------------------------------------------------------------

 if (function == "JF")

 {

 int IJstart = inData.indexOf('X');

 int IJTabstart = inData.indexOf('T');

 int IJInputNum = inData.substring(IJstart + 1, IJTabstart).toInt();

 if (digitalRead(IJInputNum) == HIGH)

 {

 Serial.println("True\n");

 }

 if (digitalRead(IJInputNum) == LOW)

 {

 Serial.println("False\n");

 }

 }

Change

python side code

if (cmdType == "If On "):

inputIndex = command.find("Input-")

tabIndex = command.find("Tab-")

inputNum = str(command[inputIndex+6:tabIndex-9])

tabNum = str(command[tabIndex+4:])

command = "JFX"+inputNum+"T"+tabNum+"\n"

ser.write(command.encode())

ser.flushInput()

time.sleep(.2)

value = ser.readline()

if (value == b'True\n'):

index = tab1.progView.get(0, "end").index("Tab Number " + tabNum)

index = index-1

tab1.progView.selection_clear(0, END)

tab1.progView.select_set(index)

replace with the problem will be fixed

I solved the problem this way. I don't know how true. but the problem has improved.

1

Photos