THE ANNIN ROBOTICS FORUM HAS MOVED TO A NEW COMMUNITY. 👉
if on jump... dont ...
 
Notifications
Clear all

if on jump... dont work

4 Posts
2 Users
0 Reactions
50 Views
Avatar of Massimo
(@massimo)
Active Member
Joined: 2 months ago
Posts: 9
Topic starter  

Question, the "if on jump" command does not work, and "if off jump". the arduino entry works, because on the previous line I inserted a "wait on". come can i fix? Thank you.



   
Quote
Avatar of Massimo
(@massimo)
Active Member
Joined: 2 months ago
Posts: 9
Topic starter  

Resolved. change "ser.readline ()" to "ser.read ()".

 


   
ReplyQuote
Avatar of Massimo
(@massimo)
Active Member
Joined: 2 months ago
Posts: 9
Topic starter  

##If Input On Jump to Tab##

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() ************************************************this with: value = ser.read()

if (value == b'T'):

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

index = index-1

tab1.progView.selection_clear(0, END)

tab1.progView.select_set(index)

##If Input Off Jump to Tab##

if (cmdType == "If Off"):

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() *********************************************and this with: value = ser.read()

if (value == b'F'):

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

index = index-1

tab1.progView.selection_clear(0, END)

tab1.progView.select_set(index)



   
ReplyQuote
Chris Annin
(@chris-annin)
Member Admin
Joined: 2 months ago
Posts: 535
 

Thank you for the input, Ill look into why it wasn't working with ser.readline.

Chris



   
ReplyQuote
Share:
Upload your Photo