SolidWorksMagi
Senior Member
Hi,
I'm trying to figure out how to send 70 different serial data strings one string at a time using a momentary switch.
I know how to sense the momentary switch, but I need to send different serial data each time I press on the switch.
I can set an integer and increment the integer, but I don't know how to translate that integer to a subroutine name.
e.g.,
symbol integer = w0
integer=0
do
IF Switch = 1 then gosub ???
integer = integer + 1
loop
1:
serout C.2,T4800_8,(0XE3,0x02,0x16,0x74,0x0E,0x00)
return
2:
serout C.2,T4800_8,(0XE3,0x03,0x60,0x48,0x10,0x00)
return
3:
serout C.2,T4800_8,(0XE3,0x03,0x44,0x75,0x13,0x00)
return
But I can't really use 1, 2 and 3 as subroutine names.
I'm trying to figure out how to send 70 different serial data strings one string at a time using a momentary switch.
I know how to sense the momentary switch, but I need to send different serial data each time I press on the switch.
I can set an integer and increment the integer, but I don't know how to translate that integer to a subroutine name.
e.g.,
symbol integer = w0
integer=0
do
IF Switch = 1 then gosub ???
integer = integer + 1
loop
1:
serout C.2,T4800_8,(0XE3,0x02,0x16,0x74,0x0E,0x00)
return
2:
serout C.2,T4800_8,(0XE3,0x03,0x60,0x48,0x10,0x00)
return
3:
serout C.2,T4800_8,(0XE3,0x03,0x44,0x75,0x13,0x00)
return
But I can't really use 1, 2 and 3 as subroutine names.
Last edited: