Quote Originally Posted by ShaneMichael View Post
Instead of reading the HSERIN as STRING, read it as a DEC in to your WORD variable. Also you can use an interupt to know when you have data. If you got the interupt to work on your counter, you are close to getting it to work on data input. Darell Taylor interupts make it pretty easy. What you need is something like this at the begining:

Shane
Hi Shane,

Thanks for the reply.

So all I need to do (sorry for the overly noob line of questioning), is instead of...

turns_required VAR BYTE[3]
HSERIN 5000,finish,[WAIT("0"),STR turns_required \3]


I could just do this

turns_required VAR WORD[2] '(which gives me 4 bytes? ...I actually only need 3 bytes), then this ? .....
hserin 10,No_Cmd,[Dec turns_required\3]

I've bolded the bits I'm uncertain about. Presumably the DEC part means the PIC reads the HSERIN info as Decimal (as opposed to a string). But what about where it places the 3 bytes? (I declared 2 words)...how do I pull the individual bytes out again?


Re the interupts...I actually used DT's interrupt routines to get my PIC counting some 'black stripes triggering a phototransistor' - superb results. As it goes, I don't actually need interupts for my HSERIN, as the PIC will only be asking for user input at the very beginning of its program.

I would however like a more graceful way of having to enter the data in rather than using a preceding 'trigger' character (in my case a '0'), as per this line though....

HSERIN 5000,finish,[WAIT("0"),STR turns_required \3][/I]

ie I'd like my program to start running, then a user just inputs data when prompted & without having to key that extra 0 at the front - it's really a bit cack having to do that!