Hi Steve.

My attempt at using gosubs... First thing I notice is the memory saving. I Know I could improve things by putting all the letters in a table and calling them up....Ideally I would like to be able to use a 24C32 or similar but how do I get the table in there ??

That way I could have lots more messages !!!

Anyway... Any suggestions on how to improve on my basics here.

Thank you

Andy


'************************************************* ***************
'* Name : Morse_beta.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 17/08/2014 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************

TRISA=0 'All A Port outs
TRISB=0 'All B Port outs
CMCON=7

LED VAR PORTB.0 'LED Indicator

Mess: pause 2000

High led
pause 5000 'Led on for 5 seconds
low led
pause 2000 'off for 2 seconds

begin:
m: gosub dash : gosub dash : gosub lgap
o: gosub dash : gosub dash : gosub dash : gosub lgap
s: gosub dot : gosub dot : gosub dot : gosub lgap
t: gosub dash : gosub lgap
l: gosub dot : gosub dash : gosub dot : gosub dot : gosub lgap
y: gosub dash : gosub dot : gosub dash : gosub dash : gosub lgap

spc: gosub space

h: gosub dot : gosub dot : gosub dot : gosub dot : gosub lgap
a: gosub dot : gosub dash : gosub lgap
r: gosub dot : gosub dash : gosub dot : gosub lgap
mm: gosub dash : gosub dash : gosub lgap
ll: gosub dot : gosub dash : gosub dot : gosub dot : gosub lgap
e: gosub dot : : gosub lgap
ss: gosub dot : gosub dot : gosub dot : gosub lgap
sss: gosub dot : gosub dot : gosub dot : gosub lgap


pause 3500 '3.5 sec delay

goto mess

dash: high led 'dash
pause 1500
low led
pause 500
return

dot: high led 'dot
pause 500
low led
pause 500
return

lgap: pause 1000 'letter gap
return

spaceause 1000 'space
return



end