I realise that.
The thrust of my joy being, that as a newbie who has already outlayed for a Pickit2 starter kit...that I can actually use that to 'glue' my PIC to my PC (h/w serial comms wise)...ie I don't have to buy extra IC hardware, veroboard etc! (nor have my time sumped having to figure out how to connect it all together - I have enough on my plate as it is with PICs!)
How can I convert my three character string (which will always be numbers) into an actual number that my program can use - I guess what i need is a way of converting a string into a number? (or perhaps a way of taking the input as raw number vs the string method I'm using?)
My input doesn't work as a number wrt my program, as when I run it my counter starts at a different number to what I input (if for example I input 0032, the count below starts decrementing at 48, in fact it starts at 48 no matter what number I input!!)[/I]
Here's what I'm doing .....
turns_required VAR BYTE[3]
counter var byte
counter = 0
pause 800
HSEROUT [13,10]
HSEROUT ["Enter Number of turns required (with a leading 0)>>>", 13,10]
Main
HSERIN 5000,finish,[WAIT("0"),STR turns_required \3]
HSEROUT ["Number of turns will be.... ", STR turns_required \3,13,10]
counter = turns_required ' this is the key bit that isn't working as turns_required is a string
count_loop:
counter = counter -1
HSEROUT [DEC COUNTER,13,10]
pause 200
GOTO count_loop
Bookmarks