The worst programmer ever to grace this forum - ME!


Results 1 to 40 of 50

Threaded View

  1. #35
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Jumper View Post
    Just because the lid is on doesn't mean that the box is emplty.. there might not be a max232 chip, but something similar is inside the pickit2 providing the same function..
    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
    Last edited by HankMcSpank; - 21st May 2009 at 15:30.

Similar Threads

  1. Melabs U2 Programmer Command Line Options
    By Robert Wells in forum General
    Replies: 5
    Last Post: - 3rd July 2009, 02:11
  2. problems with USB programmer
    By malc-c in forum General
    Replies: 7
    Last Post: - 10th May 2007, 20:14
  3. USB programmer problems
    By uiucee2003 in forum USB
    Replies: 2
    Last Post: - 15th August 2006, 23:47
  4. General Programmer Questions
    By mslaney in forum General
    Replies: 1
    Last Post: - 17th December 2004, 18:16

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts